@@ -10,13 +10,14 @@ the case that any _execution error_ was raised and replaced with {null}.
10
10
## Response Format
11
11
12
12
:: 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 _ .
14
14
15
15
### Execution Result
16
16
17
17
:: 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_ .
20
21
21
22
An _ execution result_ must be map.
22
23
@@ -36,12 +37,22 @@ present.
36
37
The _ execution result_ may also contain an entry with key ` extensions ` . The
37
38
value of this entry is described in the "Extensions" section.
38
39
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
+
39
46
### Request Error Result
40
47
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.
45
56
46
57
A _ request error result_ must be a map.
47
58
@@ -54,15 +65,11 @@ below.
54
65
Note: It may be helpful for the {"errors"} key to appear first when serialized
55
66
to make it more apparent that errors are present.
56
67
68
+ The _ request error result_ map must not contain an entry with key {"data"}.
69
+
57
70
The _ request error result_ map may also contain an entry with key ` extensions ` .
58
71
The value of this entry is described in the "Extensions" section.
59
72
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
-
66
73
### Response Position
67
74
68
75
<a name =" sec-Path " >
@@ -117,7 +124,7 @@ The response data is the result of accumulating the resolved result of all
117
124
response positions during execution.
118
125
119
126
If 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 .
121
128
122
129
If an error was raised during the execution that prevented a valid response, the
123
130
{"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
321
328
extend the protocol however they see fit, and hence there are no additional
322
329
restrictions on its contents.
323
330
331
+ ### Additional Entries
332
+
324
333
To ensure future changes to the protocol do not break existing services and
325
334
clients, 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.
327
337
328
338
## Serialization Format
329
339
0 commit comments