-
Notifications
You must be signed in to change notification settings - Fork 2k
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
RFC: incremental delivery: without branching, with deduplication #3886
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
yaacovCR
force-pushed
the
next
branch
13 times, most recently
from
April 28, 2023 08:12
0e36b36
to
d4f1dc1
Compare
robrichard
reviewed
Apr 28, 2023
yaacovCR
force-pushed
the
next
branch
14 times, most recently
from
May 4, 2023 19:07
8cb6f27
to
a62d71e
Compare
yaacovCR
force-pushed
the
next
branch
2 times, most recently
from
June 16, 2023 08:38
afe9880
to
d59e215
Compare
yaacovCR
added a commit
that referenced
this pull request
Jun 17, 2023
extracted from #3886 depends on #3903 more refactors from the without-branching branch, a bit more fundamental than #3891 [set as patch release because it does have an observable effect on the number of payloads, see below] = iterate only through completed items = remove extra ticks by making the publisher manage changes to its state synchronously. = use children array instead of promises to manage hierarchy = have IncrementalPublisher instantiate new IncrementalDataRecords = The new publisher sometimes cause an empty `{ hasNext: false }` to be emitted. In particular, because the publisher is faster than it was, it may emit a stream result before the stream's asynchronous iterator has completed. = The new publisher may sometimes reduce the number of `{ hasNext: false }` records that are emitted. For example, when errors on the initial result filter all subsequent results, this now happens synchronously, and so the publisher knows immediately that there are no subsequent results, such that there is no need for an empty final payload.
yaacovCR
force-pushed
the
next
branch
6 times, most recently
from
July 5, 2023 12:36
18549b1
to
1b1ca5b
Compare
yaacovCR
added a commit
that referenced
this pull request
Jul 6, 2023
…nces (#3929) as memory then cannot be freed This affects both the existing branching executor on main as well as the non-branching, deduplicated version in #3886 We want to ensure that after an incremental result is sent to the client, no subsequent results reference this result so that garbage collection can free the memory associated with the result. To effect this, two changes are required: 1. Prior to this change, we performed filtering by modifying the children stored on a parent; now we add a flag on the filtered item itself, so that we no longer need a backreference from child to parent. 2. We no longer store a permanent reference on the ExecutionContext to the children of the initial result. Rather, we have the IncrementalPublisher provide a new InitialResultRecord that carries its own errors and children properties.
yaacovCR
force-pushed
the
next
branch
4 times, most recently
from
July 6, 2023 02:06
2253d69
to
272c52e
Compare
yaacovCR
force-pushed
the
next
branch
2 times, most recently
from
July 16, 2023 12:32
0dc7172
to
d3b835e
Compare
robrichard
approved these changes
Aug 24, 2023
Merging to implement graphql/defer-stream-wg#69 |
sakesun
pushed a commit
to sakesun/graphql-js
that referenced
this pull request
Sep 1, 2023
The `incremental` array is the actual data to be applied to the response, while the `completed` array return "metadata" about the execution, used to inform clients that defers are being executed and when all fields for that defer have been delivered. To ensure consistency, clients are expected to process all objects in the `incremental` array for a given payload before re-rendering the associated UIs. See graphql/defer-stream-wg#69 for full details.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This in the main PR implements the major ideas from the latest incremental delivery proposal, graphql/defer-stream-wg#69 which is centered around the idea of deduplication of execution and delivery.
This PR is part of the following stack:
#3886 = main PR (this PR!) switching to deduplication of execution/delivery
#3897 = adds pending
#3911 = adds helpers to resolvers to further delay execution of deferred fields or manage concurrency
#3895 = consolidates payloads
TODO:
[x] convert existing tests
[x] error handling
[x] filter late nulls correctly
[x] defer/streams interactions
[x] completed
[x] pending
[ ] ids and subpaths instead of paths
[ ] even more tests?