Skip to content

Commit 71ddf47

Browse files
committed
Editorial recommendations from @glasser
1 parent 1cdc3fc commit 71ddf47

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

spec/GraphQLOverHTTP.md

+15-12
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ included in the GraphQL-over-HTTP _request_, they are handled by the _server_
216216
based on the URL used.
217217

218218
Note: Be aware that `query` is a misleading parameter name as its value is a
219-
string describing one or more operations, each of which may be a query, mutation
220-
or subscription. A better name would have been `document`, but the term `query`
221-
is well established.
219+
string describing one or more operations, each of which may be a query or
220+
mutation. A better name would have been `document`, but the term `query` is well
221+
established.
222222

223223
Note: Depending on the serialization format used, values of the aforementioned
224224
parameters can be encoded differently but their names and semantics must stay
@@ -228,7 +228,8 @@ Note: Specifying `null` in JSON (or equivalent values in other formats) as
228228
values for optional request parameters is equivalent to not specifying them at
229229
all.
230230

231-
Note: {variables} and {extensions}, if set, must have a map as their value.
231+
Note: Each of the {variables} and {extensions} parameters, if set, must have a
232+
map as their value.
232233

233234
## Accept
234235

@@ -262,8 +263,10 @@ The `query` parameter MUST be the string representation of the Source Text of
262263
the Document as specified in
263264
[the Language section of the GraphQL specification](https://spec.graphql.org/draft/#sec-Language).
264265

265-
The `variables` parameter, if used, MUST be represented as a URL-encoded JSON
266-
string.
266+
The `operationName`, if present, must be a string.
267+
268+
Each of the `variables` and `extensions` parameters, if used, MUST be
269+
represented as a URL-encoded JSON string.
267270

268271
### Example
269272

@@ -373,10 +376,10 @@ And the body:
373376

374377
# Response
375378

376-
When a server receives a GraphQL request, it must return a well‐formed response.
377-
The server's response describes the result of validating and executing the
378-
requested operation if successful, and describes any errors encountered during
379-
the request.
379+
When a server receives a {GraphQL-over-HTTP request}, it must return a
380+
well‐formed response. The server's response describes the result of validating
381+
and executing the requested operation if successful, and describes any errors
382+
encountered during the request.
380383

381384
A server must comply with
382385
[RFC7231](https://datatracker.ietf.org/doc/html/rfc7231).
@@ -534,9 +537,9 @@ The following examples provide guidance on how to deal with specific error cases
534537
when using the `application/graphql+json` media type to encode the response
535538
body:
536539

537-
##### Invalid request body or parsing failure
540+
##### Invalid parameters or parsing failure
538541

539-
For example: `NONSENSE`, `{"qeury": "{__typena`
542+
For example a POST response body of `NONSENSE` or `{"qeury": "{__typena`.
540543

541544
Requests that do not constitute a well-formed GraphQL request should result in
542545
status code `400` (Bad Request).

0 commit comments

Comments
 (0)