-
Notifications
You must be signed in to change notification settings - Fork 66
Remove ambiguity about operationName=null in GET requests
#385
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,9 +237,6 @@ Note: An HTTP request that encodes parameters of the same names but of the wrong | |
| type, or that omits required parameters, is not a well-formed _GraphQL-over-HTTP | ||
| request_. | ||
|
|
||
| Note: Specifying `null` for optional request parameters is equivalent to not | ||
| specifying them at all. | ||
|
|
||
| Note: So long as it is a string, {query} does not have to parse or validate to | ||
| be part of a well-formed _GraphQL-over-HTTP request_. | ||
|
|
||
|
|
@@ -285,19 +282,19 @@ the document as specified in | |
|
|
||
| The {operationName} parameter, if present, must be a string. | ||
|
|
||
| Each of the {variables} and {extensions} parameters, if used, MUST be encoded as | ||
| a JSON string. | ||
| Each of the {variables} and {extensions} parameters, if present and not the | ||
| empty string, MUST be encoded as a JSON string. | ||
|
Comment on lines
+285
to
+286
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| The {operationName} parameter, if supplied and not the empty string, represents | ||
| The {operationName} parameter, if present and not the empty string, represents | ||
|
Comment on lines
-291
to
+288
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "present" for consistency |
||
| the name of the operation to be executed within the {query} as a string. | ||
|
|
||
| Specifying the empty string for optional request parameters is equivalent to not | ||
| specifying them at all. | ||
|
|
||
| Note: In the final URL all of these parameters will appear in the query | ||
| component of the request URL as URL-encoded values due to the WHATWG | ||
| URLSearchParams encoding specified above. | ||
|
|
||
| Setting the value of the {operationName} parameter to the empty string is | ||
| equivalent to omitting the {operationName} parameter. | ||
|
|
||
|
Comment on lines
+291
to
-300
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the rule more generic. Allow setting the empty string for variables and extensions. |
||
| Note: By the above, `operationName=null` represents an operation with the name | ||
| `"null"` (such as `query null { __typename }`). If a literal `null` is desired, | ||
| either omit {operationName} or set it to the empty string. | ||
|
|
@@ -384,6 +381,9 @@ object. | |
| Servers receiving a request with additional properties MUST ignore properties | ||
| they do not understand. | ||
|
|
||
| Specifying `null` for optional request parameters is equivalent to not | ||
| specifying them at all. | ||
|
|
||
| ### Example | ||
|
|
||
| If we wanted to execute the following GraphQL query: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved to the "JSON encoding" section. As it was, it would also apply to the "GET" section and contradict the fact that
operationName=nullrepresents an operation with the name "null" (such asquery null { __typename }).