From 57041462cb64b1448ba2b3be121975ac37280b2d Mon Sep 17 00:00:00 2001 From: Thomas Welton Date: Tue, 5 Mar 2024 19:38:26 +0000 Subject: [PATCH] Include the compatible graphql version to incremental delivery docs (#7834) Updated the [documentation on incremental delivery](https://www.apollographql.com/docs/apollo-server/workflow/requests#incremental-delivery-experimental) to include the specific prerelease version of graphQL that Apollo Server is compatible with for incremental delivery. The current docs state "As of September 2022...", but a new pre release version was made available in 2023 https://github.com/graphql/graphql-js/releases/tag/v17.0.0-alpha.3 and this appears to contain a breaking change in the incremental payload delivery. --- .circleci/config.yml | 2 +- docs/source/workflow/requests.md | 2 +- smoke-test/prepare.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad05bc72a1d..44938d6852b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,7 +64,7 @@ jobs: node-version: "18" # Install a prerelease of graphql-js 17 with incremental delivery support. # --legacy-peer-deps because nothing expects v17 yet. - - run: npm i --legacy-peer-deps graphql@17.0.0-alpha.1.canary.pr.3361.04ab27334641e170ce0e05bc927b972991953882 + - run: npm i --legacy-peer-deps graphql@17.0.0-alpha.2 - run: npm run test:ci - run: npm run test:smoke diff --git a/docs/source/workflow/requests.md b/docs/source/workflow/requests.md index c057221a089..f06096eff46 100644 --- a/docs/source/workflow/requests.md +++ b/docs/source/workflow/requests.md @@ -91,7 +91,7 @@ For more details, see [the CSRF prevention documentation](../security/cors#preve ## Incremental delivery (experimental) -Incremental delivery is a [Stage 2: Draft Proposal](https://github.com/graphql/graphql-spec/pull/742) to the GraphQL specification which adds `@defer` and `@stream` executable directives. These directives allow clients to specify that parts of an operation can be sent after an initial response, so that slower fields do not delay all other fields. As of September 2022, the `graphql` library (also known as `graphql-js`) upon which Apollo Server is built implements incremental delivery only in the unreleased major version 17. If a pre-release of `graphql@17` is installed in your server, Apollo Server 4 can execute these incremental delivery directives and provide streaming [`multipart/mixed`](https://github.com/graphql/graphql-over-http/blob/main/rfcs/IncrementalDelivery.md) responses. +Incremental delivery is a [Stage 2: Draft Proposal](https://github.com/graphql/graphql-spec/pull/742) to the GraphQL specification which adds `@defer` and `@stream` executable directives. These directives allow clients to specify that parts of an operation can be sent after an initial response, so that slower fields do not delay all other fields. As of September 2022, the `graphql` library (also known as `graphql-js`) upon which Apollo Server is built implements incremental delivery only in the unreleased major version 17. If a pre-release of `graphql@17.0.0-alpha.2` is installed in your server, Apollo Server 4 can execute these incremental delivery directives and provide streaming [`multipart/mixed`](https://github.com/graphql/graphql-over-http/blob/main/rfcs/IncrementalDelivery.md) responses. Support for incremental delivery in graphql version 17 is [opt-in](https://github.com/robrichard/defer-stream-wg/discussions/12), meaning the directives are not defined by default. In order to use `@defer` or `@stream`, you must provide the appropriate definition(s) in your SDL. The definitions below can be pasted into your schema as-is: diff --git a/smoke-test/prepare.sh b/smoke-test/prepare.sh index 7352432a8a7..a5f6b0de850 100755 --- a/smoke-test/prepare.sh +++ b/smoke-test/prepare.sh @@ -21,7 +21,7 @@ npm i if [[ -n "${INCREMENTAL_DELIVERY_TESTS_ENABLED:-}" ]]; then npm i --no-save --legacy-peer-deps \ "$TARBALL_DIR"/*.tgz \ - graphql@17.0.0-alpha.1.canary.pr.3361.04ab27334641e170ce0e05bc927b972991953882 + graphql@17.0.0-alpha.2 else npm i --no-save "$TARBALL_DIR"/*.tgz fi