Replies: 1 comment 1 reply
-
Hi! Great question. Basically, in order to continue execution, GraphQL-Ruby needs some non- So, the solution you shared above is fine, but it could be even simpler -- it doesn't have to be a hash with keys matching the child field names. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Recently, when implementing Indeed's Job API I stumbled across on how they nested their hundreds of mutations into "namespace" types, like:
As you can see, "createSourcedJObPostings" is nested under "jobsIngest"; from the graphql file:
This namespace patterns seems to be also supported by Apollo.
I liked that pattern, because when implementing CRUD operations in mutations, the names get so long and repeating. So I tried it with GraphQL-Ruby:
Which compiles, create a good looking .graphql file:
but when I ran the query:
I got this error:
Reading the error messages, i dabbled around a little, and lo' and behold, this seems to do the trick:
Is this accidentally, or a pattern officially supported by GraphQL-Ruby?
If yes, maybe there could be more documentation on it, or some way to reduce the boilerplate of the people_mutations method here.
Beta Was this translation helpful? Give feedback.
All reactions