-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
feat(core): Reimplement fetch source as async generator #3043
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
This reimplements the makeFetchSource recursive promise calls as an async iterator, as they can now be converted seamlessly to Wonka sources since `[email protected]`. This is an older change we had stashed away but did not apply in a previous refactor. See: 6aab7d1
Instead of the chunking now being deterministic of how many results to issue, `incremental` is now an array, which means we can flush results as fast as possible.
JoviDeCroock
approved these changes
Mar 14, 2023
This couldn't really have realistically worked anyway, since a 3xx response to a GraphQL request is out-of-spec.
kitten
force-pushed
the
feat/fetch-source-refactor
branch
from
March 14, 2023 17:15
72ca2fc
to
8a39fd6
Compare
kitten
force-pushed
the
feat/fetch-source-refactor
branch
from
March 14, 2023 17:25
8a39fd6
to
a1ddb49
Compare
kitten
force-pushed
the
feat/fetch-source-refactor
branch
from
March 14, 2023 17:43
060153a
to
e109114
Compare
kitten
force-pushed
the
feat/fetch-source-refactor
branch
from
March 14, 2023 18:27
45f38f1
to
8ce67c3
Compare
kitten
force-pushed
the
feat/fetch-source-refactor
branch
2 times, most recently
from
March 14, 2023 18:44
7924a49
to
bc8b587
Compare
kitten
force-pushed
the
feat/fetch-source-refactor
branch
from
March 14, 2023 18:48
4cd3e31
to
eedc540
Compare
JoviDeCroock
approved these changes
Mar 15, 2023
Closed
Merged
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.
Summary
This builds on
fix/node-memory-leak-fetch-source
to finally reimplement the fetch source implementation as an async generator, wrapped in afromAsyncIterable
conversion fromwonka
.This also simplifies some of the existing logic, as per how
meros
works, and how Incremental Delivery is defined. For instance, we now assume that each chunk is a JSON blob instead of checking headers, which we aren't using or merging anyway.6.06kB -> 5.89 kB
min+gzipSet of changes
makeFetchSource
with async generator