Major Changes
-
#8272
66bd442Thanks @glasser! - Previously, this published package contained copies compiled both as ECMAScript modules (ESM) and as CommonJS. It is now published only as ESM, without a CommonJS build. All supported versions of Node.js allow you torequire()ESM code from CommonJS code.Even though Node.js's own module loader should be able to use this module from CommonJS code without configuration changes, other ways of running code might need small adjustments. Specifically, some configurations of Jest and TypeScript may need changes; see the migration guide for details.
While Apollo Server v6.0.0 is ESM-only, it does not yet depend on any other ESM-only package at runtime. (This will make it easier to change our minds and return to publishing CommonJS builds if this change was premature.) However, we may choose to start depending on ESM-only packages in a future minor release.
-
#8246
89486b2Thanks @glasser! - Require GraphQL.js v17. Thegraphqlpeer dependency is now^17.1.0; Apollo Server 6 does not support GraphQL.js v16 (nor does it support pre-release versions of GraphQL.js v17, as Apollo Server 5 did experimentally). Before upgrading, read the GraphQL.js v16 to v17 upgrade guide for changes to GraphQL.js itself.Incremental delivery (
@deferand@stream) now works natively without needing to install an alpha version of GraphQL.js. Clients must request incremental delivery with theaccept: multipart/mixed; incrementalSpec=v0.2HTTP header.Other packages that peer-depend on
graphqlmust also accept v17; in particular, use@apollo/gatewayv2.14.5 or later and@apollo/subgraphv2.16.0 or later. -
#8247
069d645Thanks @glasser! - Remove support for the legacy incremental delivery format (accept: multipart/mixed; deferSpec=20220824), along with thelegacyExperimentalExecuteIncrementallyconstructor option. Operations that use@deferor@streamfrom clients that only accept that format now receive a406 Not Acceptableerror; clients should sendaccept: multipart/mixed; incrementalSpec=v0.2instead.The
GraphQLExperimental*Alpha2andGraphQLExperimental*Alpha9types are no longer exported from@apollo/server.GraphQLResponseBodyand thewillSendSubsequentPayloadplugin hook now use theFormattedInitialIncrementalExecutionResultandFormattedSubsequentIncrementalExecutionResulttypes exported fromgraphql(which have the same shape as the removedAlpha9types).GraphQLResponseBody'ssubsequentResultsis now theAsyncGeneratorthatgraphqlreturns (FormattedExperimentalIncrementalExecutionResults['subsequentResults']) rather than a plainAsyncIterable, so you can callreturn()on it. -
#8273
3d0cc56Thanks @glasser! - The integration test suite no longer depends on Jest, and thejestand@jest/globalspeer dependencies are gone. Instead,defineIntegrationTestSuitenow takes a "test runner" as its first argument, which is an object that defines a few functions likedescribeandit. You can pass the@jest/globalsorvitestmodule objects as test runners for Jest or Vitest, passnew NodeTestRunner()(exported here) to work with Node's built-innode --test, or define your own runner. -
#8244
0976350Thanks @glasser! - Drop support for Node.js v20, which reached end-of-life on April 30, 2026. Apollo Server 6 requires Node.js v22.18.0 or later (engines.node: ">=22.18").Apollo Server 6 also adopts a new policy for Node.js support: once a Node.js major version reaches end-of-life, Apollo Server may drop support for it with a minor release rather than a major release. Such a change will be called out in the changelog. This policy only applies to Node.js versions, not other dependencies.
Apollo Server is now compiled with TypeScript's
es2024target and lib (every supported Node.js version implements ES2024).
Minor Changes
-
#8251
7bafc03Thanks @glasser! - Requests can now carry anAbortSignal. Web framework integrations can optionally include one inHTTPGraphQLRequest, and plugins can set or replacerequestContext.request.http.signalinrequestDidStart(for example, to combine the integration's signal withAbortSignal.timeout()). If a signal is present, Apollo Server checks it at several points while processing the request (such as before parsing, validation, and execution) and forwards it to GraphQL.js execution. Execution as a whole will stop early if the signal fires, and individual resolvers can access it viainfo.getAbortSignal()if they want to abort their own work. If the signal fires, requests will end with a new error code,REQUEST_ABORTED(for an incremental delivery response whose initial payload has already been sent, each still-pending deferred fragment or stream completes with that error).startStandaloneServerprovides anAbortSignaland fires it if the client disconnects before the response is finished.