-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Your schema defines a mutation field newItem
that takes 3 arguments, but mutation fields must have exactly one argument named input
.
#663
Comments
See the Relay Mutation Spec. |
Relay requires that GraphQL schema follow a few conventions - single arguments to mutations is one of them. |
Aha, I see. Thanks for the super fast response! I was looking at this mutations guide which seems to be a bit out of date? It doesn't mention the special "input" variable anywhere ]= |
@jaredonline Yeah, that guide is meant to cover mutations on the Relay side, but we should probably link to the Mutations Spec from that guide. PRs welcome! ;-) |
Is there any chance to pass multiple arguments to mutations? I have seen some code like this somewhere |
@Ansalibrahim I have the same problem too. The document states that:
so I assumed we can pass multiple arguments when doing mutations. I'm getting the same getVariables() {
return {
name: this.props.name,
type: this.props.type,
}
} I checked out my schema.js just to make sure an So this could be something in !UPDATE! After looking through more recent issues, it seems that it is true that input is required. So on the GraphQL side I wrapped all my previous args in a field called |
@Naoto-Ida Glad you got this solved. We've documented this requirement in the Relay Mutation Spec, but if there are other places that you expected to see it and didn't, please submit a PR to update the docs! |
@josephsavona Ok, thank you for pointing that out. I'll see if I can submit a PR this week. |
I'm not sure what's goin' on here. I've seen a lot of examples in the wild that take multiple arguments for a mutation.
The introspection looks like:
Query:
Response
Is this actually a problem with my schema or something else?
The text was updated successfully, but these errors were encountered: