Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions spec/GraphQLOverHTTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment on lines -240 to -241
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 }).


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

Expand Down Expand Up @@ -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
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


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

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

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.
Expand Down Expand Up @@ -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:
Expand Down
Loading