Skip to content

Commit 00c726b

Browse files
committed
Update terminology
Initial Execution Result > Initial Incremental Stream Result Execution Update Result > Incremental Stream Update Result
1 parent 554bf1b commit 00c726b

3 files changed

Lines changed: 89 additions & 83 deletions

File tree

spec/Appendix E -- Examples.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ fragment HomeWorldFragment on Person {
2222
```
2323

2424
The response to this request will be an _incremental stream_ consisting of an
25-
_initial execution result_ followed by one or more _execution update result_.
25+
_initial incremental stream result_ followed by one or more _incremental stream
26+
update result_.
2627

27-
The _initial execution result_ has:
28+
The _initial incremental stream result_ has:
2829

2930
- a {"data"} entry containing the results of the GraphQL operation except for
3031
the `@defer` and `@stream` selections;
3132
- a {"pending"} entry containing two _pending result_, one for the `@defer`
3233
selection and for the the `@stream` selection, indicating that these results
33-
will be delivered in a later _execution update result_;
34+
will be delivered in a later _incremental stream update result_;
3435
- a {"hasNext"} entry with the value {true}, indicating that the response is not
3536
yet complete.
3637

@@ -55,9 +56,9 @@ this example.
5556

5657
Depending on the behavior of the backend and the time at which the deferred and
5758
streamed resources resolve, the stream may produce results in different orders.
58-
In this example, our first _execution update result_ contains the deferred data
59-
and the first streamed list item. There is one _completed result_, indicating
60-
that the deferred data has been completely delivered.
59+
In this example, our first _incremental stream update result_ contains the
60+
deferred data and the first streamed list item. There is one _completed result_,
61+
indicating that the deferred data has been completely delivered.
6162

6263
```json example
6364
{
@@ -78,10 +79,11 @@ that the deferred data has been completely delivered.
7879
}
7980
```
8081

81-
The second _execution update result_ contains the final stream results. In this
82-
example, the underlying iterator does not close synchronously so {"hasNext"} is
83-
set to {true}. If this iterator did close synchronously, {"hasNext"} would be
84-
set to {false} and this would be the final execution update result.
82+
The second _incremental stream update result_ contains the final stream results.
83+
In this example, the underlying iterator does not close synchronously so
84+
{"hasNext"} is set to {true}. If this iterator did close synchronously,
85+
{"hasNext"} would be set to {false} and this would be the final incremental
86+
stream update result.
8587

8688
```json example
8789
{
@@ -95,9 +97,10 @@ set to {false} and this would be the final execution update result.
9597
}
9698
```
9799

98-
The third _execution update result_ contains no incremental data. {"hasNext"}
99-
set to {false} indicates the end of the _incremental stream_. This execution
100-
update result is sent when the underlying iterator of the `films` field closes.
100+
The third _incremental stream update result_ contains no incremental data.
101+
{"hasNext"} set to {false} indicates the end of the _incremental stream_. This
102+
incremental stream update result is sent when the underlying iterator of the
103+
`films` field closes.
101104

102105
```json example
103106
{
@@ -134,12 +137,12 @@ fragment NameAndHomeWorldFragment on Person {
134137
In this example the response is an _incremental stream_ of the following
135138
results.
136139

137-
The _initial execution result_ contains the results of the `firstName` field.
138-
Even though it is also present in the `HomeWorldFragment`, it must be returned
139-
in the initial execution result because it is also defined outside of any
140-
fragments with the `@defer` directive. Additionally, there are two _pending
141-
result_ indicating that results for both `@defer`s in the query will be
142-
delivered in later _execution update result_.
140+
The _initial incremental stream result_ contains the results of the `firstName`
141+
field. Even though it is also present in the `HomeWorldFragment`, it must be
142+
returned in the initial incremental stream result because it is also defined
143+
outside of any fragments with the `@defer` directive. Additionally, there are
144+
two _pending result_ indicating that results for both `@defer`s in the query
145+
will be delivered in later _incremental stream update result_.
143146

144147
```json example
145148
{
@@ -156,17 +159,17 @@ delivered in later _execution update result_.
156159
}
157160
```
158161

159-
In this example, the first _execution update result_ contains the deferred data
160-
from `HomeWorldFragment`. There is one _completed result_, indicating that
161-
`HomeWorldFragment` has been completely delivered. Because the `homeWorld` field
162-
is present in two separate `@defer`s, it is separated into its own _incremental
163-
result_.
162+
In this example, the first _incremental stream update result_ contains the
163+
deferred data from `HomeWorldFragment`. There is one _completed result_,
164+
indicating that `HomeWorldFragment` has been completely delivered. Because the
165+
`homeWorld` field is present in two separate `@defer`s, it is separated into its
166+
own _incremental result_.
164167

165-
The second _incremental result_ in this _execution update result_ contains the
166-
data for the `terrain` field. This _incremental result_ contains a {"subPath"}
167-
entry to indicate to clients that the _response position_ of this result can be
168-
determined by concatenating the path from the _pending result_ with id `"0"` and
169-
the value of this {"subPath"} entry.
168+
The second _incremental result_ in this _incremental stream update result_
169+
contains the data for the `terrain` field. This _incremental result_ contains a
170+
{"subPath"} entry to indicate to clients that the _response position_ of this
171+
result can be determined by concatenating the path from the _pending result_
172+
with id `"0"` and the value of this {"subPath"} entry.
170173

171174
```json example
172175
{
@@ -186,8 +189,8 @@ the value of this {"subPath"} entry.
186189
}
187190
```
188191

189-
The second _execution update result_ contains the remaining data from the
190-
`NameAndHomeWorldFragment`. `lastName` is the only remaining field from this
192+
The second _incremental stream update result_ contains the remaining data from
193+
the `NameAndHomeWorldFragment`. `lastName` is the only remaining field from this
191194
selection that has not been delivered in a previous result. With this field now
192195
delivered, clients are informed that the `NameAndHomeWorldFragment` has been
193196
completed by the presence of the associated _completed result_. Additionally,

spec/Section 3 -- Type System.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,8 +2343,9 @@ directive @defer(
23432343
The `@defer` directive may be provided on a fragment spread or inline fragment
23442344
to indicate that execution of the related selection set should be deferred. When
23452345
a request includes the `@defer` directive, it may return an _incremental stream_
2346-
consisting of an _initial execution result_ containing all non-deferred data,
2347-
followed by one or more _execution update result_ including deferred data.
2346+
consisting of an _initial incremental stream result_ containing all non-deferred
2347+
data, followed by one or more _incremental stream update result_ including
2348+
deferred data.
23482349

23492350
The `@include` and `@skip` directives take precedence over `@defer`.
23502351

@@ -2389,9 +2390,9 @@ directive @stream(
23892390

23902391
The `@stream` directive may be provided for a field whose type incorporates a
23912392
`List` type modifier. The directive enables returning a partial list initially,
2392-
followed by additional items in one or more _execution update result_. If the
2393-
field type incorporates multiple `List` type modifiers, only the outermost list
2394-
is streamed.
2393+
followed by additional items in one or more _incremental stream update result_.
2394+
If the field type incorporates multiple `List` type modifiers, only the
2395+
outermost list is streamed.
23952396

23962397
Note: The mechanism through which items are streamed is implementation-defined
23972398
and may use technologies such as asynchronous iterators.

spec/Section 7 -- Response.md

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ stream of _execution result_.
4949
:: A GraphQL request returns an _incremental stream_ when the GraphQL service
5050
has deferred or streamed data as a result of the `@defer` or `@stream`
5151
directives. When the result of the GraphQL operation is an incremental stream,
52-
the first value will be an _initial execution result_, followed by one or more
53-
_execution update result_.
52+
the first value will be an _initial incremental stream result_, followed by one
53+
or more _incremental stream update result_.
5454

5555
### Request Error Result
5656

@@ -79,58 +79,60 @@ The _request error result_ map must not contain an entry with key {"data"}.
7979
The _request error result_ map may also contain an entry with key `extensions`.
8080
The value of this entry is described in the "Extensions" section.
8181

82-
### Initial Execution Result
82+
### Initial Incremental Stream Result
8383

84-
:: An _initial execution result_ is the first value yielded by an _incremental
85-
stream_.
84+
:: An _initial incremental stream result_ is the first value yielded by an
85+
_incremental stream_.
8686

87-
An _initial execution result_ must be a map.
87+
An _initial incremental stream result_ must be a map.
8888

89-
The _initial execution result_ must contain an entry with key {"data"}, and may
90-
contain entries with keys {"errors"} and {"extensions"}. The value of these
91-
entries are defined in the same way as an _execution result_ as described in the
92-
"Data", "Errors", and "Extensions" sections below.
89+
The _initial incremental stream result_ must contain an entry with key {"data"},
90+
and may contain entries with keys {"errors"} and {"extensions"}. The value of
91+
these entries are defined in the same way as an _execution result_ as described
92+
in the "Data", "Errors", and "Extensions" sections below.
9393

94-
The _initial execution result_ must contain an entry with the key {"hasNext"}.
95-
The value of this entry must be {true}.
94+
The _initial incremental stream result_ must contain an entry with the key
95+
{"hasNext"}. The value of this entry must be {true}.
9696

97-
The _initial execution result_ may contain an entry with the key {"pending"}.
98-
The value of this entry must be a non-empty list of _pending result_. Each
99-
_pending result_ must be a map as described in the "Pending Result" section
100-
below.
97+
The _initial incremental stream result_ may contain an entry with the key
98+
{"pending"}. The value of this entry must be a non-empty list of _pending
99+
result_. Each _pending result_ must be a map as described in the "Pending
100+
Result" section below.
101101

102-
The _initial execution result_ may contain an entry with they key
102+
The _initial incremental stream result_ may contain an entry with they key
103103
{"incremental"}. The value of this entry must be a non-empty list of
104104
_incremental result_. Each _incremental result_ must be a map as described in
105105
the "Incremental Result" section below.
106106

107-
The _initial execution result_ may contain an entry with they key {"completed"}.
108-
The value of this entry must be a non-empty list of _completed result_. Each
109-
_completed result_ must be a map as described in the "Completed Result" section
110-
below.
107+
The _initial incremental stream result_ may contain an entry with they key
108+
{"completed"}. The value of this entry must be a non-empty list of _completed
109+
result_. Each _completed result_ must be a map as described in the "Completed
110+
Result" section below.
111111

112-
### Execution Update Result
112+
### Incremental Stream Update Result
113113

114-
:: An _execution update result_ is the value yielded by an _incremental stream_
115-
for all values except the first.
114+
:: An _incremental stream update result_ is the value yielded by an _incremental
115+
stream_ for all values except the first.
116116

117-
An _execution update result_ must be a map.
117+
An _incremental stream update result_ must be a map.
118118

119-
Unlike the _initial execution result_, an _execution update result_ must not
120-
contain entries with keys {"data"} or {"errors"}.
119+
Unlike the _initial incremental stream result_, an _incremental stream update
120+
result_ must not contain entries with keys {"data"} or {"errors"}.
121121

122-
An _execution update result_ may contain an entry with the key {"extensions"}.
123-
The value of this entry is described in the "Extensions" section.
122+
An _incremental stream update result_ may contain an entry with the key
123+
{"extensions"}. The value of this entry is described in the "Extensions"
124+
section.
124125

125-
An _execution update result_ must contain an entry with the key {"hasNext"}. The
126-
value of this entry must be {true} for all but the last response in the
127-
_incremental stream_. The value of this entry must be {false} for the last
128-
response of the incremental stream.
126+
An _incremental stream update result_ must contain an entry with the key
127+
{"hasNext"}. The value of this entry must be {true} for all but the last
128+
response in the _incremental stream_. The value of this entry must be {false}
129+
for the last response of the incremental stream.
129130

130-
The _initial execution result_ may contain entries with keys {"pending"},
131-
{"incremental"}, and/or {"completed"}. The value of these entries are defined in
132-
the same way as an _initial execution result_ as described in the "Pending
133-
Result", "Incremental Result", and "Completed Result" sections below.
131+
The _initial incremental stream result_ may contain entries with keys
132+
{"pending"}, {"incremental"}, and/or {"completed"}. The value of these entries
133+
are defined in the same way as an _initial incremental stream result_ as
134+
described in the "Pending Result", "Incremental Result", and "Completed Result"
135+
sections below.
134136

135137
### Response Position
136138

@@ -389,10 +391,10 @@ discouraged.
389391
### Extensions
390392

391393
The {"extensions"} entry in an _execution result_, _request error result_,
392-
_initial execution result_, or an _execution update result_, if set, must have a
393-
map as its value. This entry is reserved for implementers to extend the protocol
394-
however they see fit, and hence there are no additional restrictions on its
395-
contents.
394+
_initial incremental stream result_, or an _incremental stream update result_,
395+
if set, must have a map as its value. This entry is reserved for implementers to
396+
extend the protocol however they see fit, and hence there are no additional
397+
restrictions on its contents.
396398

397399
### Pending Result
398400

@@ -431,16 +433,16 @@ for different deferred fragments at the same _response position_.
431433
If a pending result is not returned for a `@defer` or `@stream` directive,
432434
clients must assume that the GraphQL service chose not to incrementally deliver
433435
this data, and the data can be found either in the {"data"} entry in the
434-
_initial execution result_, or one of the prior _execution update result_ in the
435-
_incremental stream_.
436+
_initial incremental stream result_, or one of the prior _incremental stream
437+
update result_ in the _incremental stream_.
436438

437439
:: The _associated pending result_ is a specific _pending result_ associated
438440
with any given _incremental result_ or _completed result_. The associated
439441
pending result can be determined by finding the pending result where the value
440442
of its {"id"} entry is the same value of the {"id"} entry of the given
441443
incremental result or completed result. The associated pending result must
442-
appear in the _incremental stream_, in the same or prior _initial execution
443-
result_ or _execution update result_ as the given incremental result or
444+
appear in the _incremental stream_, in the same or prior _initial incremental
445+
stream result_ or _execution update result_ as the given incremental result or
444446
completed result.
445447

446448
### Incremental Result
@@ -531,8 +533,8 @@ errors. The value of this entry is described in the "Errors" section.
531533
:: A _completed result_ is used to communicate that the GraphQL service has
532534
completed the incremental delivery of the data associated with the _associated
533535
pending result_. The corresponding data must have been completed in the same
534-
_initial execution result_ or _execution update result_ in which this completed
535-
result appears.
536+
_initial incremental stream result_ or _incremental stream update result_ in
537+
which this completed result appears.
536538

537539
**Completed Result Format**
538540

0 commit comments

Comments
 (0)