@@ -183,7 +183,7 @@ using the JSON encoding for GraphQL requests:
183
183
| ------------------ | --------------------------------------- |
184
184
| ` application/json ` | Standard type for GraphQL JSON requests |
185
185
186
- And for GraphQL responses :
186
+ And for a _ GraphQL response _ :
187
187
188
188
| Name | Description |
189
189
| ----------------------------------- | ------------------------------------------------------------------ |
@@ -401,10 +401,10 @@ And the body:
401
401
402
402
# Response
403
403
404
- When a server receives a _ GraphQL-over-HTTP request_ , it must return a
405
- well‐formed response . The server's response describes the result of validating
406
- and executing the requested operation if successful, and describes any errors
407
- encountered during the request.
404
+ When a server receives a well-formed _ GraphQL-over-HTTP request_ , it must return
405
+ a well‐formed _ GraphQL response _ . The server's response describes the result of
406
+ validating and executing the requested operation if successful, and describes
407
+ any errors encountered during the request.
408
408
409
409
A server must comply with
410
410
[ RFC7231] ( https://datatracker.ietf.org/doc/html/rfc7231 ) .
@@ -478,7 +478,7 @@ algorithm.
478
478
## Status Codes
479
479
480
480
In case of errors that completely prevent the generation of a well-formed
481
- GraphQL response , the server SHOULD respond with the appropriate status code
481
+ _ GraphQL response _ , the server SHOULD respond with the appropriate status code
482
482
depending on the concrete error condition.
483
483
484
484
Note: Typically this will be the ` 400 ` (Bad Request) status code.
@@ -500,11 +500,11 @@ error_ or _GraphQL field error_ raised.
500
500
Note: A status code in the ` 4xx ` or ` 5xx ` ranges or status code ` 203 ` (and maybe
501
501
others) could originate from intermediary servers; since the client cannot
502
502
determine if an ` application/json ` response with arbitrary status code is a
503
- well-formed GraphQL response (because it cannot trust the source) the server
503
+ well-formed _ GraphQL response _ (because it cannot trust the source) the server
504
504
must use ` 200 ` status code to guarantee to the client that the response has not
505
505
been generated or modified by an intermediary.
506
506
507
- If the GraphQL response contains a non-null {data} entry then the server MUST
507
+ If the _ GraphQL response _ contains a non-null {data} entry then the server MUST
508
508
use the ` 200 ` status code.
509
509
510
510
Note: This indicates that no _ GraphQL request error_ was raised, though one or
@@ -524,35 +524,36 @@ type.
524
524
This section only applies when the response body is to use the
525
525
` application/graphql-response+json ` media type.
526
526
527
- If the GraphQL response contains the {data} entry and it is not {null}, then the
528
- server MUST reply with a ` 2xx ` status code and SHOULD reply with ` 200 ` status
529
- code.
527
+ If the _ GraphQL response _ contains the {data} entry and it is not {null}, then
528
+ the server MUST reply with a ` 2xx ` status code and SHOULD reply with ` 200 `
529
+ status code.
530
530
531
531
Note: The result of executing a GraphQL operation may contain partial data as
532
532
well as encountered errors. Errors that happen during execution of the GraphQL
533
533
operation typically become part of the result, as long as the server is still
534
- able to produce a well-formed response. There's currently not an approved HTTP
535
- status code to use for a "partial response," contenders include WebDAV's status
536
- code "207 Multi-Status" and using a custom code such as "247 Partial Success."
534
+ able to produce a well-formed _ GraphQL response_ . There's currently not an
535
+ approved HTTP status code to use for a "partial response," contenders include
536
+ WebDAV's status code "207 Multi-Status" and using a custom code such as "247
537
+ Partial Success."
537
538
[ IETF RFC2616 Section 6.1.1] ( https://datatracker.ietf.org/doc/html/rfc2616#section-6.1.1 )
538
539
states "codes are fully defined in section 10" implying that though more codes
539
540
are expected to be supported over time, valid codes must be present in this
540
541
document.
541
542
542
- If the GraphQL response contains the {data} entry and it is {null}, then the
543
+ If the _ GraphQL response _ contains the {data} entry and it is {null}, then the
543
544
server SHOULD reply with a ` 2xx ` status code and it is RECOMMENDED it replies
544
545
with ` 200 ` status code.
545
546
546
547
Note: Using ` 4xx ` and ` 5xx ` status codes in this situation is not recommended -
547
548
since no _ GraphQL request error_ has occurred it is seen as a "partial
548
549
response".
549
550
550
- If the GraphQL response does not contain the {data} entry then the server MUST
551
+ If the _ GraphQL response _ does not contain the {data} entry then the server MUST
551
552
reply with a ` 4xx ` or ` 5xx ` status code as appropriate.
552
553
553
554
Note: The GraphQL specification indicates that the only situation in which the
554
- GraphQL response does not include the {data} entry is one in which the {errors}
555
- entry is populated.
555
+ _ GraphQL response _ does not include the {data} entry is one in which the
556
+ {errors} entry is populated.
556
557
557
558
If the GraphQL request is invalid (e.g. it is malformed, or does not pass
558
559
validation) then the server SHOULD reply with ` 400 ` status code.
@@ -640,6 +641,6 @@ response; it still indicates successful execution.
640
641
641
642
If the response uses a non-` 200 ` status code and the media type of the response
642
643
payload is ` application/json ` then the client MUST NOT rely on the body to be a
643
- well-formed GraphQL response since the source of the response may not be the
644
+ well-formed _ GraphQL response _ since the source of the response may not be the
644
645
server but instead some intermediary such as API gateways, proxies, firewalls,
645
646
etc.
0 commit comments