From e76bea20ce25e12685b530e849eeb49fede93b03 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Tue, 30 Apr 2019 13:24:02 +0300 Subject: [PATCH 1/2] Add Gatsby docs config (sidebar link, etc.) for full-query caching from #2437. While #2437 did introduce the documentation and the appropriate configuration for it, it did so while we were still utilizing Hexo for our docs, and the configuration changes necessary for our docs' Gatsby-ification didn't happen. This puts the configuration in place for Gatsby and merges into the 2.5.0 release branch. Ref: https://github.com/apollographql/apollo-server/pull/2437/files#diff-b09bbff3e688a10b35f7de810d65c28e --- docs/gatsby-config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/gatsby-config.js b/docs/gatsby-config.js index 56375c027a5..dc37ab279f5 100644 --- a/docs/gatsby-config.js +++ b/docs/gatsby-config.js @@ -28,6 +28,7 @@ module.exports = { 'essentials/data', ], Features: [ + 'features/caching', 'features/mocking', 'features/errors', 'features/data-sources', From 5565d98e93076bde3f1b39d771a7e2f7062c1e0f Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Tue, 30 Apr 2019 13:34:09 +0300 Subject: [PATCH 2/2] Add link to the full-query caching docs into the `CHANGELOG.md` for v2.5.0. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d42b46c4b7..88b4fd25d38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - Add cache-control: no-cache header to both PersistedQueryNotSupportedError and PersistedQueryNotFoundError responses as these should never be cached. [PR #2452](https://github.com/apollographql/apollo-server/pull/2452) - `apollo-datasource-rest`: Don't attempt to parse "204 No Content" responses as JSON. [PR #2446](https://github.com/apollographql/apollo-server/pull/2446) - `apollo-server-express`: Fix Playground URL when Apollo Server is mounted inside of another Express app by utilizing `req.originalUrl`. [PR #2451](https://github.com/apollographql/apollo-server/pull/2451) -- 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`. [PR #2437](https://github.com/apollographql/apollo-server/pull/2437) +- 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](https://www.apollographql.com/docs/apollo-server/features/caching). [PR #2437](https://github.com/apollographql/apollo-server/pull/2437) - Allow `GraphQLRequestListener` callbacks in plugins to depend on `this`. [PR #2470](https://github.com/apollographql/apollo-server/pull/2470) - 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](https://www.apollographql.com/docs/apollo-server/features/errors#for-apollo-engine-reporting) and the [`EngineReportingOptions` API reference](https://www.apollographql.com/docs/apollo-server/api/apollo-server#enginereportingoptions). [PR #1639](https://github.com/apollographql/apollo-server/pull/1639) - `apollo-server-testing`: Add `variables` and `operationName` to `Query` and `Mutation` types. [PR #2307](https://github.com/apollographql/apollo-server/pull/2307) [Issue #2172](https://github.com/apollographql/apollo-server/issue/2172)