Skip to content

Commit acf5b18

Browse files
robrichardyaacovCR
authored andcommitted
clarify hasNext on incremental example
1 parent acf8c07 commit acf5b18

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

spec/Section 7 -- Response.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ operations that return a single response map.
4141

4242
The GraphQL server may determine there are no more values in the response stream
4343
after a previous value with `hasNext` equal to `true` has been emitted. In this
44-
case the last value in the response stream should be a map without `data`,
45-
`label`, and `path` entries, and a `hasNext` entry with a value of `false`.
44+
case the last value in the response stream should be a map without `data` and
45+
`incremental` entries, and a `hasNext` entry with a value of `false`.
4646

4747
The response map may also contain an entry with key `extensions`. This entry, if
4848
set, must have a map as its value. This entry is reserved for implementors to
@@ -326,7 +326,10 @@ Response 2, contains the defer payload and the first stream payload.
326326
}
327327
```
328328

329-
Response 3, contains an additional stream payload.
329+
Response 3, contains the final stream payload. In this example, the underlying
330+
iterator does not close synchronously so {hasNext} is set to {true}. If this
331+
iterator did close synchronously, {hasNext} would be set to {true} and this
332+
would be the final response.
330333

331334
```json example
332335
{
@@ -341,8 +344,9 @@ Response 3, contains an additional stream payload.
341344
}
342345
```
343346

344-
Response 4, contains no incremental payloads, {hasNext} set to {false} indicates
345-
the end of the stream.
347+
Response 4, contains no incremental payloads. {hasNext} set to {false} indicates
348+
the end of the response stream. This response is sent when the underlying
349+
iterator of the `films` field closes.
346350

347351
```json example
348352
{

0 commit comments

Comments
 (0)