@@ -23,24 +23,29 @@ with key `data`. The value of this entry is described in the "Data" section. If
23
23
the operation failed before execution, due to a syntax error, missing
24
24
information, or validation error, this entry must not be present.
25
25
26
+ When the response of the GraphQL operation is an event stream, the first value
27
+ will be the initial response. All subsequent values may contain ` label ` and
28
+ ` path ` entries. These two entries are used by clients to identify the the
29
+ ` @defer ` or ` @stream ` directive from the GraphQL operation that triggered this
30
+ value to be returned by the event stream. The combination of these two entries
31
+ must be unique across all values returned by the event stream.
32
+
26
33
If the response of the GraphQL operation is an event stream, each response map
27
34
must contain an entry with key ` hasNext ` . The value of this entry is ` true ` for
28
35
all but the last response in the stream. The value of this entry is ` false ` for
29
36
the last response of the stream. This entry is not required for GraphQL
30
- operations that return a single response map.
37
+ operations that return a single response map.
38
+
39
+ The GraphQL server may determine there are no more values in the event stream
40
+ after a previous value with ` hasNext ` : ` true ` has been emitted. In this case
41
+ the last value in the event stream should be a map without ` data ` , ` label ` ,
42
+ and ` path ` entries, and a ` hasNext ` entry with a value of ` false ` .
31
43
32
44
The response map may also contain an entry with key ` extensions ` . This entry,
33
45
if set, must have a map as its value. This entry is reserved for implementors
34
46
to extend the protocol however they see fit, and hence there are no additional
35
47
restrictions on its contents.
36
48
37
- When the response of the GraphQL operation is an event stream, the first value
38
- will be the initial response. All subsequent values must contain ` label ` and
39
- ` path ` entries. These two entries are used by clients to identify the the
40
- ` @defer ` or ` @stream ` directive from the GraphQL operation that triggered this
41
- value to be returned by the event stream. The combination of these two entries
42
- must be unique across all values returned by the event stream.
43
-
44
49
To ensure future changes to the protocol do not break existing servers and
45
50
clients, the top level response map must not contain any entries other than the
46
51
three described above.
@@ -250,7 +255,7 @@ When the `path` field is present on an "Error result", it indicates the response
250
255
## Label
251
256
252
257
If the response of the GraphQL operation is an event stream, subsequent values
253
- will contain a string field ` label ` . This ` label ` is the same label passed to
258
+ may contain a string field ` label ` . This ` label ` is the same label passed to
254
259
the ` @defer ` or ` @stream ` directive that triggered this value. This allows
255
260
clients to identify which ` @defer ` or ` @stream ` directive is associated with
256
261
this value.
0 commit comments