Skip to content

Clarify operation type and name requirements #441

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

Merged
merged 1 commit into from
Jun 29, 2018
Merged

Clarify operation type and name requirements #441

merged 1 commit into from
Jun 29, 2018

Conversation

jamesmacaulay
Copy link
Contributor

The current text can make it seem that an operation name is required for any mutations or subscriptions, and for any operation with variable definitions:

Up until now, we have been using a shorthand syntax where we omit both the query keyword and the query name, but in production apps it's useful to use these to make our code less ambiguous. You'll need these optional parts to a GraphQL operation if you want to execute something other than a query or pass dynamic variables.

As far as I can tell, the spec only requires operation names in multi-operation documents:

http://facebook.github.io/graphql/October2016/#sec-Language.Operations
http://facebook.github.io/graphql/October2016/#sec-Validation.Operations

This pull request modifies the text to be more precise about the requirements for operation type and name.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@leebyron leebyron merged commit 87cc061 into graphql:source Jun 29, 2018
@leebyron
Copy link
Collaborator

thanks!

Dipeshwagle pushed a commit to Dipeshwagle/graphql.github.io that referenced this pull request Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants