@@ -23,24 +23,29 @@ with key `data`. The value of this entry is described in the "Data" section. If
2323the operation failed before execution, due to a syntax error, missing
2424information, or validation error, this entry must not be present.
2525
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+
2633If the response of the GraphQL operation is an event stream, each response map
2734must contain an entry with key ` hasNext ` . The value of this entry is ` true ` for
2835all but the last response in the stream. The value of this entry is ` false ` for
2936the 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 ` .
3143
3244The response map may also contain an entry with key ` extensions ` . This entry,
3345if set, must have a map as its value. This entry is reserved for implementors
3446to extend the protocol however they see fit, and hence there are no additional
3547restrictions on its contents.
3648
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-
4449To ensure future changes to the protocol do not break existing servers and
4550clients, the top level response map must not contain any entries other than the
4651three described above.
@@ -250,7 +255,7 @@ When the `path` field is present on an "Error result", it indicates the response
250255## Label
251256
252257If 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
254259the ` @defer ` or ` @stream ` directive that triggered this value. This allows
255260clients to identify which ` @defer ` or ` @stream ` directive is associated with
256261this value.
0 commit comments