-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental support for incremental delivery (
@defer
/@stream
)
Also provides improved compatibility with the graphql-over-http spec by supporting `content-type: application/graphql-response+json` if requested via `accept` header, and adds `; charset=utf-8` to content-types. Executing `@defer` and `@stream` directives requires you to install pre-release of `graphql@17` in your server. This PR does not update `package.json` to install that prerelease (nor does it even broaden peer deps, which would be inadequate as many of its dependencies have peer deps that won't include v17). However, it does add a new CI step that installs a particular v17 pre-release and runs the test suite and smoke test (including running some otherwise-disabled tests that exercise the execution of these directives). We also add a new `__testing_incrementalExecutionResults` option that lets us test transport-level behavior without installing the prerelease. This change reworks `GraphQLResponse` and `HTTPGraphQLResponse` to allow responses to be single- or multi-part. `GraphQLResponse` had previously (in v4) moved most of its fields onto `result`; we now instead of `body` with two `kind`s determining the structure of the rest of the response. `HTTPGraphQLResponse` (new in v4) had tried to anticipate this change, but now the structure is a bit different. A few other changes were made for compatibility with `graphql@17` such as removing some uses of the non-options multi-argument GraphQLError constructor. Add two new plugin APIs: `didEncounterSubsequentErrors` and `willSendSubsequentPayload`. Updates to plugins: - Usage reporting waits until all payloads are ready before it's done with a given operation. - The response cache does not cache incremental responses (although that would likely be quite helpful). - No cache-control HTTP headers are written with incremental responses (since we don't know all the fields that will be executed yet). - Inline traces are not added to incremental delivery responses (though it might make sense to add them to the last payload or something). Fixes #6671.
- Loading branch information
Showing
46 changed files
with
1,962 additions
and
457 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@apollo/server-integration-testsuite': patch | ||
'@apollo/server-plugin-response-cache': patch | ||
'@apollo/server': patch | ||
--- | ||
|
||
Experimental support for incremental delivery (`@defer`/`@stream`) when combined with a prerelease of `graphql-js`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@apollo/server-integration-testsuite': patch | ||
'@apollo/server-plugin-response-cache': patch | ||
'@apollo/server': patch | ||
--- | ||
|
||
Support application/graphql-response+json content-type if requested via Accept header, as per graphql-over-http spec. | ||
Include `charset=utf-8` in content-type headers. |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ goofql | |
graphiql | ||
graphqlcodegenerator | ||
GraphQLJSON | ||
gzipped | ||
hackily | ||
herokuapp | ||
Hofmann | ||
|
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 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 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 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 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
Oops, something went wrong.