Users who have contributed to this file

Changelog

The version headers in this history reflect the versions of Apollo Server itself. Versions of other packages (e.g. which are not actual HTTP integrations; packages not prefixed with apollo-server) may use different versions. For more details, check the publish commit for that version in the Git history.

vNEXT

The changes noted within this vNEXT section have not been released yet. New PRs and commits which introduce changes should include an entry in this vNEXT section as part of their development. When a release is being prepared, a new header will be (manually) created below and the the appropriate changes within that release will be moved into the new section.

Nothing yet! Stay tuned!

v2.9.3

apollo-server-express: Add direct dependency on express to allow for usage of express.Router for getMiddleware functionality (from #2435). Previously, unlike other server integration packages, apollo-server-express did not directly need express as a dependency since it only relied on express for TypeScript typings. Issue #3238PR #3239

apollo-server-lambda: Add @types/aws-lambda as a direct dependency to apollo-server-express to allow usage of its typings without needing to separately install it. Issue #2351PR #3242

v2.9.1

apollo-server-core: Make formatError available to subscriptions in the same spirit as the existing formatResponse. PR #2942

apollo-engine-reporting: The behavior of the engine.maxAttempts parameter previously did not match its documentation. It is documented as being the max number of attempts including the initial attempt, but until this release it was actually the number of retries excluding the initial attempt. The behavior has been changed to match the documentation (and the literal reading of the option name). PR #3218

apollo-engine-reporting: When sending the report fails with a server-side 5xx error, include the full error from the server in the logs. PR #3218

apollo-server-core: Fix regression which prevented the resizing of the schema panel in GraphQL Playground. PR #3224 and upstream

v2.9.0

apollo-server-express, apollo-server-koa: A new getMiddleware method has been introduced, which accepts the same parameters as applyMiddleware with the exception of the app property. This allows implementors to obtain the middleware directly and "use" it within an existing app. In the near-term, this should ease some of the pain points with the previous technique. Longer-term, we are exploring what we consider to be a much more natural approach by introducing an "HTTP transport" in Apollo Server 3.x. See this proposal issue for more information. PR #2435

@apollo/federation: buildFederatedSchema's typeDefs parameter now accepts arrays of DocumentNodes (i.e. type definitions wrapped in gql) and resolvers to make the migration from a single service into a federated service easier for teams previously utilizing this pattern. PR #3188

apollo-server-hapi: Revert switch from accept and boom which took place in v2.8.0. PR #3089

@apollo/gateway: Change the setInterval timer, which is used to continuously check for updates to a federated graph from the Apollo Graph Manager, to be an unref'd timer. Without this change, the server wouldn't terminate properly once polling had started since the event-loop would continue to have unprocessed events on it. PR #3105

Switch to using community @types/graphql-upload types.

apollo-server-fastify: Change the typing of the HTTP response from OutgoingMessage to ServerResponse. Commit

apollo-server-hapi: Pass the raw request and response objects to graphql-uploads processRequest method to align on the same TypeScript types. Commit

v2.8.0

@apollo/federation: Add support for "value types", which are type definitions which live on multiple services' types, inputs, unions or interfaces. These common types must be identical by name, kind and field across all services. PR #3063

apollo-server-express: Use the Express send method, rather than calling net.Socket.prototype.end. PR #2842

apollo-server-hapi: Update internal dependencies to use scoped packages @hapi/accept and @hapi/boom, in place of accept and boom respectively. PR #3089

v2.7.2

apollo-engine-reporting: Fix reporting errors from backend. (The support for federated metrics introduced in v2.7.0 did not properly handle GraphQL errors from the backend; all users of federated metrics should upgrade to this version.) PR #3056Issue #3052

v2.7.1

apollo-engine-reporting: If an error is thrown by a custom variable transform function passed into the reporting option sendVariableValues: { transform: ... }, all variable values will be replaced with the string [PREDICATE_FUNCTION_ERROR].

apollo-server-express: Typing fix for the connection property, which was missing from the ExpressContext interface. PR #2959

@apollo/gateway: Ensure execution of correct document within multi-operation documents by including the operationName in the cache key used when caching query plans used in federated execution. PR #3084

v2.7.0

apollo-engine-reporting: Behavior change: By default, send no GraphQL variable values to Apollo's servers instead of sending all variable values. Adding the new EngineReportingOption sendVariableValues to send some or all variable values, possibly after transforming them. This replaces the privateVariables option, which is now deprecated. PR #2931

To maintain the previous behavior of transmitting all GraphQL variable values, unfiltered, to Apollo Engine, configure engine.sendVariableValues as follows:

engine: {
sendVariableValues: { all:true }
}

apollo-engine-reporting: Behavior change: By default, send no GraphQL request headers and values to Apollo's servers instead of sending all. Adding the new EngineReportingOption sendHeaders to send some or all header values. This replaces the privateHeaders option, which is now deprecated. PR #2931

To maintain the previous behavior of transmitting all GraphQL request headers and values, configure engine.sendHeaders as following:

engine: {
sendHeaders: { all:true }
}

apollo-engine-reporting: Behavior change: If the error returned from the engine.rewriteError hook has an extensions property, that property will be used instead of the original error's extensions. Document that changes to most other GraphQLError fields by engine.rewriteError are ignored. PR #2932

apollo-engine-reporting: Behavior change: The engine.maskErrorDetails option, deprecated by engine.rewriteError in v2.5.0, now behaves a bit more like the new option: while all error messages will be redacted, they will still show up on the appropriate nodes in a trace. PR #2932

@apollo/gateway@0.7.1: Don't print a warning about an unspecified "graph variant" (previously, and in many ways still, known as "schema tag") every few seconds. We do highly recommend specifying one when using the Apollo Platform features though! PR #3043

v2.6.1

Revert: Don't add cacheControl directive if one has already been defined. Presently, although the TypeScript don't suggest it, passing a String as typeDefs to ApolloServer is supported and this would be a breaking change for non-TypeScript users. PR #2428

v2.6.0

apollo-server-core: Introduce new didEncounterErrors life-cycle hook which has access to unformatted errors property on the requestContext, which is the first positional parameter that this new request life-cycle receives. PR #2719

apollo-server-core: Allow request pipeline life-cycle hooks (i.e. plugins) to modify the response's http.status code (an integer) in the event of an error. When combined with the new didEncounterErrors life-cycle hook (see above), this will allow modifying the HTTP status code in the event of an error. PR #2714

apollo-server-lambda: Set callbackWaitsForEmptyEventLoop to false for OPTIONS requests to return as soon as the callback is triggered instead of waiting for the event loop to empty. PR #2638

apollo-server: Support onHealthCheck in the ApolloServer constructor in the same way as cors is supported. This contrasts with the -express, -hapi, etc. variations which accept this parameter via their applyMiddleware methods and will remain as-is. PR #2672

apollo-server-cache-redis: BREAKING FOR USERS OF apollo-server-cache-redis (This is a package that must be updated separately but shares the same CHANGELOG.md with Apollo Server itself.) A new major version of this package has been published and updated to support Redis Standalone, Cluster and Sentinel modes. This is a breaking change since it is now based on ioredis instead of node_redis. Although this update is compatible with the most common uses of apollo-server-cache-redis, please check the options supported by ioredis while updating to this version. The constructor options are passed directly from RedisCache to the new Redis adapter. The pre-1.0 versions should continue to work with Apollo Server without modification. PR #1770

v2.5.1

Upgrade GraphQL Playground to the latest upstream release. This release also includes a new "Query Plan" panel for displaying the query planning results when running the Apollo Gateway.

v2.5.0

New

New plugin package apollo-server-plugin-response-cache implementing a full query response cache based on apollo-cache-control hints. The implementation added a few hooks and context fields; see the PR for details. There is a slight change to cacheControl object: previously, cacheControl.stripFormattedExtensions defaulted to false if you did not provide a cacheControl option object, but defaulted to true if you provided (eg) cacheControl: {defaultMaxAge: 10}. Now stripFormattedExtensions defaults to false unless explicitly provided as true, or if you use the legacy boolean cacheControl: true. For more information, read the documentation. PR #2437

Add rewriteError option to EngineReportingOptions (i.e. the engine property of the ApolloServer constructor). When defined as a function, it will receive an err property as its first argument which can be used to manipulate (e.g. redaction) an error prior to sending it to Apollo Engine by modifying, e.g., its message property. The error can also be suppressed from reporting entirely by returning an explicit null value. For more information, read the documentation and the EngineReportingOptions API reference. maskErrorDetails is now deprecated. PR #1639

v2.4.8

No functional changes in this version. The patch version has been bumped to fix the README.md displayed on the npm package for apollo-server as a result of a broken publish. Apologies for the additional noise!

v2.4.7

Fix typings which incorrectly included cors as part of the constructor options for apollo-server-express (it should be defined via applyMiddleware) but, conversely, inadvertently omitted the perfectly valid cors option from the apollo-server constructor (where applyMiddleware is not used/available). PR #2373Issue #1882

Type the formatError function to accept an GraphQLError as an argument and return a GraphQLFormattedError PR #2343

v2.4.2

apollo-server-fastify is now on Apollo Server and lives within the apollo-server repository. This is being introduced in a patch version, however it's a major version bump from the last time apollo-server-fastify was published under 1.0.2. PR #1971

v2.3.1

Provide types for graphql-upload in a location where they can be accessed by TypeScript consumers of apollo-server packages. ccf935f9Issue #2092

v2.3.0

BREAKING FOR NODE.JS <= 8.5.0 ONLY: To continue using Apollo Server 2.x in versions of Node.js prior to v8.5.0, file uploads must be disabled by setting uploads: false on the ApolloServer constructor options. Without explicitly disabling file-uploads, the server will throw at launch (with instructions and a link to our documentation).

This early deprecation is due to changes in the third-party graphql-upload package which Apollo Server utilizes to implement out-of-the-box file upload functionality. While, in general, Apollo Server 2.x aims to support all Node.js versions which were under an LTS policy at the time of its release, we felt this required an exception. By throw-ing when uploads is not explicitly set to false, we aim to make it clear immediately (rather than surprisingly) that this deprecation has taken effect.

While Node.js 6.x is covered by a Long Term Support agreement by the Node.js Foundation until April 2019, there are substantial performance (e.g. V8 improvements) and language changes (e.g. "modern" ECMAScript support) offered by newer Node.js engines (e.g. 8.x, 10.x). We encourage all users of Apollo Server to update to newer LTS versions of Node.js prior to the "end-of-life" dates for their current server version.

We intend to drop support for Node.js 6.x in the next major version of Apollo Server.

v2.2.7

apollo-engine-reporting: When multiple instances of apollo-engine-reporting are loaded (an uncommon edge case), ensure that encodedTraces are handled only once rather than once per loaded instance. PR #2040

v2.2.6

apollo-server-micro: Set the Content-type to text/html for GraphQL Playground. PR #2026

v2.2.5

Follow-up on the update to graphql-playground-html in previous release by also bumping the minor version of the graphql-playground-react dependency to 1.7.10 — which is the version requested from the from the CDN bundle by graphql-playground-html. PR #2037

v2.2.4

v2.2.3

When generateClientInfo is not used to define the client name, client version and
client reference ID, Apollo Server will now default to the values present in the HTTP headers
of the request (apollographql-client-name, apollographql-client-reference-id and
apollographql-client-version respectively). As a last resort, when those headers are not set,
the query extensions' clientInfo values will be used. PR #1960

v2.2.2

v2.2.1

Added support for an array of modules on the ApolloServer constructor options. Each element of the modules can point to a module which exports typeDefs and resolvers. These modules can be used in lieu of, or in combination with, directly specifying schema or typeDefs/resolvers on the constructor options. This provides greater modularity and improved organization for logic which might be limited to a specific service. 8f6481e6.

Add support for a requestAgent configuration parameter within the engine configuration. This can be utilized when a proxy is necessary to transmit tracing and metrics data to Apollo Engine. It accepts either an http.Agent or https.Agent and behaves the same as the agent parameter to Node.js' http.request. PR #1879

Allow an optional parameter to the RESTDataSource constructor which takes a node-fetch-compatible fetch implementation that will be used for HTTP calls instead of the default fetch. PR #1807

The typing on the context of GraphQLServerOptions now matches the equivilent type used by graphql-tools. PR #919

Middleware handlers now used named (rather than anonymous) functions to enable easier identification during debugging/profiling. PR #827

The npm-check-updates package has been removed as a "dev dependency" which was resulting in an older version of npm being used during testing. PR #959

The typing on HttpQueryRequest's query attribute now enforces that its object properties' keys be Strings. PR #834

TypeScript types have been updated via updates to @types/node, @types/connect, @types/koa and @types/aws-lambda.

v1.3.4

Upgrade to apollo-cache-control@0.1.0 and allow you to specify options to it (such as the new defaultMaxAge) by passing cacheControl: {defaultMaxAge: 5} instead of cacheControl: true.

v1.3.3

Updated peer dependencies to support graphql@0.13.x.

apollo-server-express: The GraphQLOptions type is now exported from apollo-server-express in order to facilitate type checking when utilizing graphqlExpress, graphiqlExpress, graphqlConnect and graphiqlConnect. PR #871

v1.0.3

Revert #463,
because it's a breaking change that shouldn't have been a patch update.

v1.0.2

Rename packages from graphql-server- to apollo-server- #465. We'll continue to publish graphql-server- packages that depend on the renamed apollo-server- packages for the time being, to ensure backwards compatibility.

v1.0.1

Fix Express package not calling the callback on completion (@chemdrew) in #463