Skip to content

Remove ambiguity about operationName=null in GET requests#385

Merged
martinbonnin merged 3 commits into
mainfrom
null-get
Apr 23, 2026
Merged

Remove ambiguity about operationName=null in GET requests#385
martinbonnin merged 3 commits into
mainfrom
null-get

Conversation

@martinbonnin
Copy link
Copy Markdown
Contributor

Also unify the wording.

Comment thread spec/GraphQLOverHTTP.md
Comment on lines -240 to -241
Note: Specifying `null` for optional request parameters is equivalent to not
specifying them at all.
Copy link
Copy Markdown
Contributor Author

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=null represents an operation with the name "null" (such as query null { __typename }).

Comment thread spec/GraphQLOverHTTP.md
Comment on lines +285 to +286
Each of the {variables} and {extensions} parameters, if present and not the
empty string, MUST be encoded as a JSON string.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • used -> present for consistency
  • explicit the possibility of using empty string in GET requests

Comment thread spec/GraphQLOverHTTP.md
Comment on lines -291 to +288
The {operationName} parameter, if supplied and not the empty string, represents
The {operationName} parameter, if present and not the empty string, represents
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"present" for consistency

Comment thread spec/GraphQLOverHTTP.md
Comment on lines +291 to -300
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

@martinbonnin martinbonnin changed the title Do not allow operationName=null in GET requests Remove ambiguity about operationName=null in GET requests Apr 17, 2026
Copy link
Copy Markdown
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Comment thread spec/GraphQLOverHTTP.md Outdated
Copy link
Copy Markdown
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is slightly normative (specifically it's explicitly allowing ?variables= and ?extensions= which were previously disallowed, I think?) but am inclined to merge it anyway since it improves consistency and clarity. Will give others a chance to review before merging.

@martinbonnin martinbonnin merged commit c550716 into main Apr 23, 2026
6 checks passed
@martinbonnin martinbonnin deleted the null-get branch April 23, 2026 18:10
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.

4 participants