@@ -10,13 +10,14 @@ the case that any _execution error_ was raised and replaced with {null}.
1010## Response Format
1111
1212:: A GraphQL request returns a _ response_ . A _ response_ is either an _ execution
13- result_ , a _ request error result _ , or a _ response stream _ .
13+ result_ , a _ response stream _ , or a _ request error result _ .
1414
1515### Execution Result
1616
1717:: A GraphQL request returns an _ execution result_ when the GraphQL operation is
18- a query or mutation and the request included execution. Additionally, an
19- execution result is the event emitted by a _ response stream_ .
18+ a query or mutation and the request included execution. Additionally, for each
19+ event in a subscription's _ source stream_ , the _ response stream_ will emit an
20+ _ execution result_ .
2021
2122An _ execution result_ must be map.
2223
@@ -36,12 +37,22 @@ present.
3637The _ execution result_ may also contain an entry with key ` extensions ` . The
3738value of this entry is described in the "Extensions" section.
3839
40+ ### Response Stream
41+
42+ :: A GraphQL request returns a _ response stream_ when the GraphQL operation is a
43+ subscription and the request included execution. A response stream must be a
44+ stream of _ execution result_ .
45+
3946### Request Error Result
4047
41- :: A GraphQL request returns a _ request error result_ when the request fails
42- before execution. A request may fail before execution due to a syntax error,
43- missing information, or validation error, resulting in one or more _ request
44- error_ being raised. This request will result in no response data.
48+ :: A GraphQL request returns a _ request error result_ when one or more _ request
49+ error_ are raised, causing the request to fail before execution. This request
50+ will result in no response data.
51+
52+ Note: A _ request error_ may be raised before execution due to missing
53+ information, syntax errors, validation failure, coercion failure, or any other
54+ reason the implementation may determine should prevent the request from
55+ proceeding.
4556
4657A _ request error result_ must be a map.
4758
@@ -54,15 +65,11 @@ below.
5465Note: It may be helpful for the {"errors"} key to appear first when serialized
5566to make it more apparent that errors are present.
5667
68+ The _ request error result_ map must not contain an entry with key {"data"}.
69+
5770The _ request error result_ map may also contain an entry with key ` extensions ` .
5871The value of this entry is described in the "Extensions" section.
5972
60- ### Response Stream
61-
62- :: A GraphQL request returns a _ response stream_ when the GraphQL operation is a
63- subscription and the request included execution. A response stream must be a
64- stream of _ execution result_ .
65-
6673### Response Position
6774
6875<a name =" sec-Path " >
@@ -117,7 +124,7 @@ The response data is the result of accumulating the resolved result of all
117124response positions during execution.
118125
119126If an error was raised before execution begins, the _ response_ must be a
120- _ request error result_ . The {"data"} entry must not be present in this map .
127+ _ request error result_ which will result in no response data .
121128
122129If an error was raised during the execution that prevented a valid response, the
123130{"data"} entry in the response should be ` null ` .
@@ -321,9 +328,12 @@ set, must have a map as its value. This entry is reserved for implementers to
321328extend the protocol however they see fit, and hence there are no additional
322329restrictions on its contents.
323330
331+ ### Additional Entries
332+
324333To ensure future changes to the protocol do not break existing services and
325334clients, the _ execution result_ and _ request error result_ maps must not contain
326- any entries other than those described above.
335+ any entries other than those described above. Clients must ignore any entries
336+ other than those described above.
327337
328338## Serialization Format
329339
0 commit comments