3 ms·
Curious how response depth is usually handled in something like this, especially if recursion comes into play. Don't know much yet about Relay.
by j_s 11y ago
Curious how response depth is usually handled in something like this, especially if recursion comes into play. Don't know much yet about Relay.
- tuukkah 11y agoThere's no unbounded recursion in GraphQL: response depth equals query depth.
- tlrobinson 11y agoYou have to specify the depth in the query by explicitly describing each level. There's no way to specify infinite depth (by design). https://github.com/facebook/graphql/issues/91 https://github.com/facebook/graphql/issues/91 If you really wanted to get all the comments on a post, for example, you would have to have a flattened "comments" listing (but each comment could have an id and parent id, which you could use to re-build the nested structure on the client)
- calebmer 11y agoFacebook handles malicious queries by setting a list of permitted queries. I want to get this implemented soon at the server layer, check out my PR here: https://github.com/graphql/express-graphql/pull/77 https://github.com/graphql/express-graphql/pull/77