Skip to content

Commit fa4358e

Browse files
committed
address PR comments
1 parent 1dbb9c6 commit fa4358e

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

spec/Section 7 -- Response.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2122
An _execution result_ must be map.
2223

@@ -36,12 +37,22 @@ present.
3637
The _execution result_ may also contain an entry with key `extensions`. The
3738
value 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

4657
A _request error result_ must be a map.
4758

@@ -54,15 +65,11 @@ below.
5465
Note: It may be helpful for the {"errors"} key to appear first when serialized
5566
to make it more apparent that errors are present.
5667

68+
The _request error result_ map must not contain an entry with key {"data"}.
69+
5770
The _request error result_ map may also contain an entry with key `extensions`.
5871
The 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
117124
response positions during execution.
118125

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

122129
If 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
321328
extend the protocol however they see fit, and hence there are no additional
322329
restrictions on its contents.
323330

331+
### Additional Entries
332+
324333
To ensure future changes to the protocol do not break existing services and
325334
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.
327337

328338
## Serialization Format
329339

0 commit comments

Comments
 (0)