-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Two prior conversations triggered this ticket. This (closed) ticket #91 and this conversation in Slack https://graphql.slack.com/archives/general/p1478088194004298. Unlike the closed ticket, this should explicitly be considered a feature exploration/request, not necessarily a question about how to do nesting/recursion.
Understanding that GraphQL is about being explicit and declarative, how would/could one be declarative and specify recursion. This is a known limitation that would need to be addressed: https://facebook.github.io/graphql/#sec-Fragment-spreads-must-not-form-cycles One suggestion from the Slack thread was to relax the requirement a bit by allowing @recursive limits. There may need to be a default limit too.
Potential example.
fragment PersonFields on Person {
name
primaryAddress { street }
parents @recursive(maxDepth: 8)
}
fragment EmployeeFields on EmployeeInterface {
primaryAddress { street}
boss @recursive(maxDepth: 4)
}
{
person(id: 1) {
… PersonFields
… EmployeeFields
}
}
One strong aspect of graphs is deep nesting. Is this a possibly worthy feature request?