【发布时间】:2019-04-16 16:37:42
【问题描述】:
我一直在读到,使用最大查询深度来保护您的应用程序非常重要。意思是,限制查询的“级别”数量。一个非常深的查询示例:
query IAmEvil {
author(id: "abc") {
posts {
author {
posts {
author {
posts {
author {
# that could go on as deep as the client wants!
}
}
}
}
}
}
}
}
如何知道查询的深度?并最终不允许执行深度超过 4 的查询。 我可以获得完整的查询以手动计算深度吗?还是他们已经实现了?
这里也描述了这个问题:https://www.howtographql.com/advanced/4-security/
【问题讨论】: