-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add support for the new incremental format in GraphQL 17.0.0-alpha.9 #12926
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
base: release-4.1-baseline
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 14e5a98 The changes in this PR will be included in the next version bump. 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 |
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 2721fb02f556da014fcc07d7 |
commit: |
size-limit report 📦
|
if (hasDirectives(["defer"], request.query)) { | ||
const context = request.context ?? {}; | ||
const http = (context.http ??= {}); | ||
http.accept = ["multipart/mixed", ...(http.accept || [])]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A previous comment asked if we should also have a deferSpec
identifier here, and the thinking is yes, since that version of the protocol still isn’t guaranteed to end up as the final version.
We were thinking of using 20230621
as the identifier (as a reference to this doc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests weren't actually testing defer but a regular query that emitted multiple values. To be honest, I'm not sure how useful these tests are given this should theoretically never happen in a real application (at least for queries). That said, I just removed the @defer in the queries for now since it was misleading since it wasn't actually testing defer payloads.
).toBeUndefined(); | ||
}); | ||
|
||
it("deduplicates queries as long as a query still has deferred chunks", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved @defer
tests to their own subfolders. This test still exists in src/core/__tests__/client.watchQuery/defer20220824.test.tsx
Fixes #12245
Adds support for using the
@defer
directive with the new incremental delivery format as implemented in[email protected]
.