Skip to content

RFC: incremental delivery with deduplication + concurrent execution #1034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 65 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
fca1c5d
Introduce @defer and @stream.
robrichard Aug 18, 2022
43e9997
fix typos
robrichard Feb 17, 2021
cb5a3f4
clear up that it is legal to support either defer or stream individually
robrichard Feb 17, 2021
0eb4426
Add sumary of arguments to Type System
robrichard Feb 17, 2021
43bfe01
Update Section 3 -- Type System.md
robrichard May 15, 2021
acb5bf0
clarification on defer/stream requirement
robrichard Nov 19, 2021
abea59b
clarify negative values of initialCount
robrichard Nov 20, 2021
139d69f
allow extensions only subsequent payloads
robrichard Nov 25, 2021
de5004b
fix typo
robrichard Nov 26, 2021
9e89f42
Raise a field error if initialCount is less than zero
robrichard Aug 18, 2022
f894ba3
data is not necessarily an object in subsequent payloads
robrichard Dec 6, 2021
08053d7
add Defer And Stream Directives Are Used On Valid Root Field rule
robrichard Dec 6, 2021
e19246b
wait for parent async record to ensure correct order of payloads
robrichard Aug 18, 2022
2ecd0af
Simplify execution, payloads should begin execution immediately
robrichard Dec 20, 2021
337bb87
Clarify error handling
robrichard Dec 20, 2021
2982dec
add isCompletedIterator to AsyncPayloadRecord to track completed iter…
robrichard Dec 30, 2021
32fb73b
fix typo
robrichard Jan 21, 2022
1ff999e
deferDirective and visitedFragments
robrichard Feb 2, 2022
270b409
stream if argument, indexPath -> itemPath
robrichard Feb 7, 2022
75f2258
Clarify stream only applies to outermost list of multi-dimensional ar…
robrichard Feb 7, 2022
d8c28d1
add validation “Defer And Stream Directive Labels Are Unique”
robrichard Mar 7, 2022
eb3a4e3
Clarification on labels
robrichard Mar 8, 2022
f2b50bf
fix wrong quotes
robrichard Mar 23, 2022
92f02f3
remove label/path requirement
robrichard Mar 23, 2022
049bce8
add missing line
robrichard Jun 9, 2022
9a07500
fix ExecuteRequest
robrichard Jun 9, 2022
7c5e1da
fix response
robrichard Jun 9, 2022
19cb9c3
Align deferred fragment field collection with reference implementation
robrichard Aug 3, 2022
c747f61
spec updates to reflect latest discussions
robrichard Aug 18, 2022
6f3c715
Note about mutation execution order
robrichard Aug 18, 2022
7c9ea0a
minor change for uniqueness
robrichard Aug 18, 2022
d84939e
fix typos
robrichard Aug 18, 2022
1ad7e9c
if: Boolean! = true
robrichard Aug 23, 2022
4b6554e
address pr feedback
robrichard Aug 23, 2022
9103fdb
clarify null behavior of if
robrichard Aug 24, 2022
3944d05
Add error boundary behavior
robrichard Sep 8, 2022
90b31ae
defer/stream response => payload
robrichard Sep 8, 2022
f1c0ec2
event stream => response stream
robrichard Sep 8, 2022
3830406
link to path section
robrichard Sep 8, 2022
f950efb
use case no dash
robrichard Sep 8, 2022
ad5b2e2
remove "or null"
robrichard Sep 8, 2022
c1f3f65
add detailed incremental example
robrichard Sep 8, 2022
2e41749
update label validation rule
robrichard Sep 8, 2022
abb14a0
clarify hasNext on incremental example
robrichard Sep 8, 2022
4ea2a34
clarify canceling of subsequent payloads
robrichard Sep 8, 2022
1565491
Add examples for non-null cases
robrichard Sep 8, 2022
a938f44
typo
robrichard Sep 9, 2022
a301f21
improve non-null example
robrichard Sep 9, 2022
38bfbb9
Add FilterSubsequentPayloads algorithm
robrichard Sep 9, 2022
8d07dee
link to note on should
robrichard Oct 12, 2022
008818d
update on hasNext
robrichard Nov 1, 2022
4adb05a
small fixes (#3)
yaacovCR Nov 7, 2022
ddd0fd7
remove ResolveFIeldGenerator (#4)
yaacovCR Nov 16, 2022
b54c9fe
fix typos (#6)
yaacovCR Nov 18, 2022
02d4676
Add error handling for stream iterators (#5)
yaacovCR Nov 21, 2022
3e74250
Raise a field error if defer/stream encountered during subscription e…
robrichard Nov 22, 2022
cb3ab46
Add validation rule for defer/stream on subscriptions
robrichard Nov 22, 2022
24cf072
clarify label is not required
robrichard Nov 23, 2022
d74430c
fix parentRecord argument in ExecuteStreamField (#7)
yaacovCR Nov 29, 2022
79da712
fix typo
robrichard Dec 5, 2022
8df13da
replace server with service
robrichard Jan 15, 2023
94363c9
CollectFields does not require path or asyncRecord (#11)
yaacovCR Jan 16, 2023
fe9d871
incremental delivery with deduplication, concurrent delivery, and ear…
yaacovCR May 21, 2023
831b10c
scattered fixes, streamlining
yaacovCR Sep 26, 2023
813ea2c
use identifiers instead of records when possible
yaacovCR Sep 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clarification on defer/stream requirement
# Conflicts:
#	spec/Section 3 -- Type System.md
  • Loading branch information
robrichard committed Jan 15, 2023
commit acb5bf09756b8f4603c58d29c1114f0ee9f3fca4
22 changes: 17 additions & 5 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -2157,9 +2157,9 @@ fragment someFragment on User {

#### @defer Arguments

- `if: Boolean` - When `true`, fragment may be deferred. When `false`, fragment
will not be deferred and data will be included in the initial response. If
omitted, defaults to `true`.
- `if: Boolean` - When `true`, fragment _should_ be deferred. When `false`,
fragment will not be deferred and data will be included in the initial
response. If omitted, defaults to `true`.
- `label: String` - A unique label across all `@defer` and `@stream` directives
in an operation. This label should be used by GraphQL clients to identify the
data from patch responses and associate it with the correct fragments. If
Expand Down Expand Up @@ -2188,12 +2188,24 @@ query myQuery($shouldStream: Boolean) {

#### @stream Arguments

- `if: Boolean` - When `true`, field may be streamed. When `false`, the field
will not be streamed and all list items will be included in the initial
- `if: Boolean` - When `true`, field _should_ be streamed. When `false`, the
field will not be streamed and all list items will be included in the initial
response. If omitted, defaults to `true`.
- `label: String` - A unique label across all `@defer` and `@stream` directives
in an operation. This label should be used by GraphQL clients to identify the
data from patch responses and associate it with the correct fragments. If
provided, the GraphQL Server must add it to the payload.
- `initialCount: Int` - The number of list items the server should return as
part of the initial response. If omitted, defaults to `0`.

Note: The ability to defer and/or stream parts of a response can have a
potentially significant impact on application performance. Developers generally
need clear, predictable control over their application's performance. It is
highly recommended that GraphQL servers honor the `@defer` and `@stream`
directives on each execution. However, the specification allows advanced
use-cases where the server can determine that it is more performant to not defer
and/or stream. Therefore, GraphQL clients _must_ be able to process a response
that ignores the `@defer` and/or `@stream` directives. This also applies to the
`initialCount` argument on the `@stream` directive. Clients _must_ be able to
process a streamed response that contains a different number of initial list
items than what was specified in the `initialCount` argument.