-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
(experimental) - Add full support for multipart/mixed defer and stream directive responses #1854
Conversation
🦋 Changeset detectedLatest commit: 91b6650 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
2b1ed8c
to
61028a9
Compare
6b46f98
to
ff61e9a
Compare
d699304
to
ebec0e6
Compare
ebec0e6
to
9e91428
Compare
We've released initial prerelease versions:
This will automatically enable this PR's patch. It may be necessary to create a resolution in Yarn, e.g. |
This adds support for "multipart/mixed" GraphQL results, which are used in delivering defer/stream responses. See: https://github.com/graphql/graphql-over-http/blob/main/rfcs/IncrementalDelivery.md See: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
WIP: This is temporary and we may swap out the wording here
8929511
to
d3d5bb4
Compare
e05cbb1
to
8bcd7a3
Compare
8bcd7a3
to
91b6650
Compare
Add experimental support for
@defer
and@stream
responses for GraphQL. This implements the "GraphQL Defer and Stream Directives" and "Incremental Delivery over HTTP" specifications. If a GraphQL API supportsmultipart/mixed
responses for deferred and streamed delivery of GraphQL results,@urql/core
(and all its derived fetch implementations) will attempt to stream results. This is only supported on browsers supporting streamed fetch responses, which excludes IE11.The implementation of streamed multipart responses is derived from
meros
by@maraisr
, and is subject to change if the RFCs end up changing.For more information, read: https://graphql.org/blog/2020-12-08-improving-latency-with-defer-and-stream-directives
On fresh builds with a quick gzip check across all minified files (
$ cat packages/core/dist/*.min.mjs | gzip-size
) we see an increase from5.32kB
minzipped to6.02kB
minzipped, meaning a delta of approximately700B
.On Graphcache (
$ cat exchanges/graphcache/dist/*.min.mjs | gzip-size
) we see a change from9.38kB
to9.55kB
, a delta of170B
.Therefore we can estimate that the total impact of this feature is limited to
<1kB
minzipped.