-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass arguments from one field to the next #29
Comments
First of all, thanks for continuing to try About recursing into comments a variable number of times: this is a little tricky to express as a GraphQL query. The query you show would only return comments and their comments (2 levels). I'm not aware of a clever way to achieve this without actually writing out each level in the query itself. As such, this is not a shortcoming of |
Yes, you're correct about that, and Lee Byron has made a suggestion using fragments + spread + manually writing out the depth graphql/graphql-spec#91 (comment) - I was hoping I could express that as an argument at the top level via the |
Hmmm, I don't know anything about the implementation of the OCaml server, but I don't really see how this could work within the GraphQL type system. What is the type of the nested #28 refers to recursive type definitions in a schema, which other servers also support and which is perfectly fine in GraphQL. But there is no way to express recursion in a query without fragments, and recursive fragments are explicitly disallowed. |
This is related to #28, trying to have an argument for a field that allows explicit depth, e.g.
Assuming
comment
is anio_field
,depth
?~default:(Some 1)
causes a type error I can't quite get arounddepth
is positive, and if so recurse intocomments
while decrementing thedepth
argument.Would you mind providing an example?
The text was updated successfully, but these errors were encountered: