Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
716e00b
initial commit - drop support for node v14
trevor-scheer Mar 28, 2023
4a6f43c
changeset
trevor-scheer Apr 17, 2023
4a9dd74
Specify target of ES2015 (required by lru-cache major which uses priv…
trevor-scheer Apr 17, 2023
13f0ee1
Stop testing Node 14, start testing Node 20
trevor-scheer Apr 17, 2023
ec0862d
missed a target
trevor-scheer Apr 17, 2023
ed04d99
Remove config option
trevor-scheer Apr 18, 2023
440b97b
changeset
trevor-scheer Apr 18, 2023
229ffee
migration guide
trevor-scheer Apr 18, 2023
4022320
v4 docs should no longer redirect to main (which is now v5)
trevor-scheer Apr 18, 2023
f884c9e
clean up references to AS4 + misc docs cleanup
trevor-scheer Apr 18, 2023
9a19cd5
pick the highest npm version compatible with CS:CI
trevor-scheer Apr 18, 2023
2827286
lockfile
trevor-scheer Apr 18, 2023
8cca0cc
update node version
trevor-scheer Apr 18, 2023
1c538de
Revert a few things
trevor-scheer Apr 28, 2023
c2ea69b
update test
trevor-scheer Apr 28, 2023
106fc66
node 20 test updates
trevor-scheer Apr 28, 2023
c7cedc1
update previously blocked major versions
trevor-scheer Jul 24, 2023
a09145c
remove precomputedNonce
trevor-scheer Jul 24, 2023
4b99b26
target es2015 for smoke tests
trevor-scheer Jul 24, 2023
5d939f3
cleanup unused imports
trevor-scheer Jul 24, 2023
1c4dd18
Merge branch 'main' into version-5
trevor-scheer Jul 28, 2023
04d8f07
remove a couple fixmes
trevor-scheer Jul 28, 2023
be62ec0
drop node 16 as well (eol in ~6 weeks)
trevor-scheer Jul 28, 2023
5753454
Remove node-abort-controller
trevor-scheer Jul 28, 2023
4716838
allow npm@8 for csci
trevor-scheer Jul 28, 2023
bca644d
Update docs/source/migration.mdx
trevor-scheer Jul 31, 2023
0e93c3f
Merge remote-tracking branch 'origin/main' into version-5
glasser May 13, 2025
343b7d7
Require Node v20; test against Node v24
glasser May 13, 2025
1fb2dae
Merge remote-tracking branch 'origin/main' into version-5
glasser May 14, 2025
9269373
Stop running tests against EOLed @apollo/gateway 0.x
glasser May 14, 2025
d7b6362
Just use npm that comes with Node
glasser May 14, 2025
ad4eb49
Upgrade Nock from v13 to v14
glasser May 15, 2025
dc1f771
Synchronize complete request for subscription test
tninesling May 16, 2025
58ca299
Add our standard Nock beforeEach/afterEach to a test that was missing it
glasser May 21, 2025
dc8f74e
Revert "tests: drop prettier-2 (#7971)"
glasser May 21, 2025
bcb126f
Switch default fetcher from node-fetch to built-in Node fetch
glasser May 21, 2025
0c4b885
Update snapshots
glasser May 21, 2025
9230eed
Snapshot whitespace changes
glasser May 21, 2025
b94b317
Prettier
glasser May 21, 2025
cec2a15
Merge remote-tracking branch 'origin/main' into version-5
glasser May 21, 2025
1bd255e
Fix spell-check
glasser May 21, 2025
2fa64f5
Upgrade cspell
glasser May 21, 2025
7eef82c
Upgrade lru-cache
glasser May 21, 2025
ae320ea
Upgrade typescript and @apollo/utils.keyvaluecache
glasser May 21, 2025
c7de889
Upgrade whatwg-mimetype
glasser May 21, 2025
0e0eb9b
Upgrade rollup
glasser May 21, 2025
d0c5731
Upgrade uuid
glasser May 21, 2025
407fed5
We are no longer pinning npm separately from Node
glasser May 21, 2025
186a8f7
Upgrade negotiator
glasser May 21, 2025
f43860c
Upgrade ts-jest
glasser May 21, 2025
b6c6224
Upgrade eslint
glasser May 22, 2025
228c8dc
Run `npm run codegen` before upgrading
glasser May 23, 2025
c27b92c
Upgrade graphql-codegen
glasser May 23, 2025
f0ac87e
Upgrade graphql-tools
glasser May 23, 2025
fdb33c4
Rewrite standalone server to not use Express
glasser May 23, 2025
4cb2a1d
Remove express4 integration
glasser May 24, 2025
082e4ec
Merge remote-tracking branch 'origin/main' into version-5
glasser Jun 3, 2025
f08129b
Initial stab at compatibility with newer GraphQL.JS 17 alphas
glasser Jun 4, 2025
c4eb72b
Only allow incremental delivery with [email protected]
glasser Jun 11, 2025
bfdd217
Test against both alpha.2 and alpha.9
glasser Jun 11, 2025
195b7eb
Merge remote-tracking branch 'origin/main' into version-5
glasser Jun 13, 2025
749ec47
Subscription callback function takes a fetcher
glasser Jun 13, 2025
c420402
docs: remove config.json
glasser Jun 16, 2025
96396ba
Update proxy configuration for AS5
glasser Jun 17, 2025
685fd33
Update TS lib/target to ES2023 (supported by Node v20)
glasser Jun 17, 2025
d59b600
AS5 proxy configuration docs suggestions (#8080)
mabuyo Jun 18, 2025
900c346
Update migration guide for v5
glasser Jun 18, 2025
acaaefd
Update previous-versions
glasser Jun 23, 2025
0a53649
Minor doc improvements
glasser Jun 23, 2025
f3a94e5
Improve how we describe subscription support
glasser Jun 23, 2025
f047b68
Address all FIXMEs that can easily be addressed offline
glasser Jun 23, 2025
a5d908d
Slightly bump graphql-js peer dep
glasser Jun 23, 2025
dd49923
The subscription callback protocol has not been preview for a while
glasser Jun 25, 2025
bbeddd1
Set AS4 deprecation date
glasser Jun 25, 2025
4d80fd1
Miscellaneous doc updates
glasser Jun 25, 2025
08dd5fe
More miscellaneous doc updates
glasser Jun 27, 2025
f1e5c06
More doc updates
glasser Jun 28, 2025
2b16d06
Update descriptions of plans
glasser Jul 1, 2025
c700d79
Remove FIXMEs from docs-examples links
glasser Jul 1, 2025
034fca0
Merge branch 'version-4' into version-5
glasser Jul 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/curvy-crabs-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@apollo/server-integration-testsuite': major
'@apollo/server-plugin-response-cache': major
'@apollo/server-gateway-interface': major
'@apollo/server': major
---

Drop support for Node.JS v14, v16, and v20.
7 changes: 7 additions & 0 deletions .changeset/five-tips-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@apollo/server': major
---

Remove `precomputedNonce` landing page configuration option

This option was introduced and subsequently deprecated in v4. Removing this configuration in v4 is strictly an improvement to the security of your landing page, and no longer exists in v5.
5 changes: 5 additions & 0 deletions .changeset/large-lines-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@apollo/server': patch
---

ApolloServerPluginSubscriptionCallback now takes a `fetcher` argument, like the usage and schema reporting plugins. The default value is Node's built-in fetch.
5 changes: 5 additions & 0 deletions .changeset/orange-plants-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@apollo/server': major
---

Remove `status400ForVariableCoercionErrors` configuration option; this regression mitigation is now the default behavior in Apollo Server v5.
29 changes: 22 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,33 @@ jobs:
- setup-node
- run: npm run test:smoke

Full incremental delivery tests with graphql-js 17 canary:
Full incremental delivery tests with graphql 17 alpha 2:
docker:
- image: cimg/base:stable
environment:
INCREMENTAL_DELIVERY_TESTS_ENABLED: t
GRAPHQL_JS_VERSION: 17.0.0-alpha.2
steps:
- setup-node:
node-version: "18"
node-version: "20"
# 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 [email protected]
- run: npm i --legacy-peer-deps "graphql@${GRAPHQL_JS_VERSION}"
- run: npm run test:ci
- run: npm run test:smoke

Test with recent graphql-js alpha:
docker:
- image: cimg/base:stable
environment:
GRAPHQL_JS_VERSION: 17.0.0-alpha.9
steps:
- setup-node:
node-version: "20"
# Install a newer prerelease of graphql-js 17; we do not yet support
# its incremental delivery format.
# --legacy-peer-deps because nothing expects v17 yet.
- run: npm i --legacy-peer-deps "graphql@${GRAPHQL_JS_VERSION}"
- run: npm run test:ci
- run: npm run test:smoke

Expand Down Expand Up @@ -142,18 +158,17 @@ workflows:
matrix:
parameters:
node-version:
- "14"
- "16"
- "18"
- "20"
- "22"
- "24"
- "Check for FIXM\x45"
- Prettier
- ESLint
- Spell check
- Codegen check
- Smoke test built package
- Full incremental delivery tests with graphql-js 17 canary
- Full incremental delivery tests with graphql 17 alpha 2
- Test with recent graphql-js alpha
- Changesets
security-scans:
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"packages/usage-reporting-protobuf"
],
"sandboxes": ["apollo-server-typescript-3opde","apollo-server"],
"node": "18"
"node": "20"
}
5 changes: 0 additions & 5 deletions .config/mise/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
# It's what we use to set up tools in CI.

[tools]
# This actually uses the copy of npm that comes with Node to install the version
# of npm that we want. Since we test on ancient versions of Node like v14, we
# want to use a slightly more modern npm. Listing it before "node" means we'll
# actually use it instead of the version that comes with node.
"npm:npm" = "9.9.4"
node = "22.17.0"

[env]
Expand Down
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

27 changes: 0 additions & 27 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG_historical.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Certain undersupported and underused Apollo Server features have been removed in
- `apollo-engine-reporting`: Fix regression introduced by [#3614](https://github.com/apollographql/apollo-server/pull/3614) which caused `PersistedQueryNotFoundError`, `PersistedQueryNotSupportedError` and `InvalidGraphQLRequestError` errors to be triggered before the `requestDidStart` handler triggered `treeBuilder`'s `startTiming` method. This fix preserves the existing behavior by special-casing these specific errors. [#3638](https://github.com/apollographql/apollo-server/pull/3638) fixes [#3627](https://github.com/apollographql/apollo-server/issues/3627)
- `apollo-server-cloud-functions`: Transmit CORS headers on `OPTIONS` request. [#3557](https://github.com/apollographql/apollo-server/pull/3557)
- `apollo-server-caching`: De-compose options interface for `KeyValueCache.prototype.set` to accommodate better TSDoc annotations for its properties (e.g. to specify that `ttl` is defined in _seconds_). [#3619](https://github.com/apollographql/apollo-server/pull/3619)
- `apollo-server-core`, `apollo-server-caching`: Introduce a `ttl` property, specified in seconds, on the options for automated persisted queries (APQ) which applies specific TTL settings to the cache `set`s during APQ registration. Previously, all APQ cache records were set to 300 seconds. Additionally, this adds support (to the underlying `apollo-server-caching` mechanisms) for a time-to-live (TTL) value of `null` which, when supported by the cache implementation, skips the assignment of a TTL value altogether. This allows the cache's controller to determine when eviction happens (e.g. cache forever, and purge least recently used when the cache is full), which may be desireable for network cache stores (e.g. Memcached, Redis). [#3623](https://github.com/apollographql/apollo-server/pull/3623)
- `apollo-server-core`, `apollo-server-caching`: Introduce a `ttl` property, specified in seconds, on the options for automated persisted queries (APQ) which applies specific TTL settings to the cache `set`s during APQ registration. Previously, all APQ cache records were set to 300 seconds. Additionally, this adds support (to the underlying `apollo-server-caching` mechanisms) for a time-to-live (TTL) value of `null` which, when supported by the cache implementation, skips the assignment of a TTL value altogether. This allows the cache's controller to determine when eviction happens (e.g. cache forever, and purge least recently used when the cache is full), which may be desirable for network cache stores (e.g. Memcached, Redis). [#3623](https://github.com/apollographql/apollo-server/pull/3623)
- `apollo-server-core`: Upgrade TS to 3.7.3 [#3618](https://github.com/apollographql/apollo-server/pull/3618)

## v2.9.14
Expand Down
8 changes: 5 additions & 3 deletions docs/source/_sidebar.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
switcher:
heading: 'Apollo Server'
versions:
- label: v4
- label: v4–v5
latest: true
href: ./
- label: v3
Expand All @@ -13,10 +13,12 @@ items:
href: '.'
- label: Get started
href: './getting-started'
- label: New in v4
- label: New in v4 and v5
children:
- label: Migrating to Apollo Server 4
- label: Migrating from Apollo Server 4
href: './migration'
- label: Migrating from Apollo Server 3
href: './migration-from-v3'
- label: Previous versions
href: './previous-versions'
- label: Changelog
Expand Down
6 changes: 3 additions & 3 deletions docs/source/api/apollo-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@
</td>
<td>

**Set this option to `true`.** It mitigates a regression introduced in Apollo Server v4 where the server returns a 200 status code (instead of 400) when a client query provides invalid variables. [Learn more.](../migration/#known-regressions)
> Note: Apollo Server v5 defaults this option to `true`. This option is deprecated in v5 and will be ignored in a future major version.

Apollo Server v5 will _always_ behave as if this option is `true` (and will ignore any provided value).
**Apollo Server v4 users should set this option to `true` (or better yet, upgrade to v5).** It mitigates a regression introduced in Apollo Server v4 where the server returns a 200 status code (instead of 400) when a client query provides invalid variables.

Check warning on line 511 in docs/source/api/apollo-server.mdx

View check run for this annotation

Apollo Librarian / AI Style Review

docs/source/api/apollo-server.mdx#L511

Use the imperative mood for instructions and avoid using bold for emphasis. ```suggestion If you use Apollo Server v4, set this option to <code>true</code> (or better yet, upgrade to v5). It mitigates a regression introduced in Apollo Server v4 where the server returns a 200 status code (instead of 400) when a client query provides invalid variables. ```

</td>
</tr>
Expand Down Expand Up @@ -651,7 +651,7 @@

The `response` object returned from `executeOperation` is a `GraphQLResponse`, which has `body` and `http` fields.

Apollo Server 4 supports incremental delivery directives such as `@defer` and `@stream` (when combined with an appropriate version of `graphql-js`), and so the structure of `response.body` can represent either a single result or multiple results. `response.body.kind` is either `'single'` or `'incremental'`. If it is `'single'`, then incremental delivery has not been used, and `response.body.singleResult` is an object with `data`, `errors`, and `extensions` fields. If it is `'incremental'`, then `response.body.initialResult` is the initial result of the operation, and `response.body.subsequentResults` is an async iterator that will yield subsequent results. (The precise structure of `initialResult` and `subsequentResults` is defined by `graphql-js` and may change between the current pre-release of `graphql-js` v17 and its final release; if you write code that processes these values before `graphql-js` v17 has been released you may have to adapt it when the API is finalized.)
Apollo Server 4 and 5 support incremental delivery directives such as `@defer` and `@stream` when combined with pre-release version `17.0.0-alpha.2` of `graphql-js`, and so the structure of `response.body` can represent either a single result or multiple results. `response.body.kind` is either `'single'` or `'incremental'`. If it is `'single'`, then incremental delivery has not been used, and `response.body.singleResult` is an object with `data`, `errors`, and `extensions` fields. If it is `'incremental'`, then `response.body.initialResult` is the initial result of the operation, and `response.body.subsequentResults` is an async iterator that will yield subsequent results. (The precise structure of `initialResult` and `subsequentResults` is defined by `graphql-js` and may change between the current pre-release of `graphql-js` v17 and its final release; if you write code that processes these values before `graphql-js` v17 has been released you may have to adapt it when the API is finalized. Apollo Server currently only supports `17.0.0-alpha.2`, not newer alphas which use a different format.)

Check notice on line 654 in docs/source/api/apollo-server.mdx

View check run for this annotation

Apollo Librarian / AI Style Review

docs/source/api/apollo-server.mdx#L654

Favor the present tense ("yields" instead of "will yield") and use "might" instead of "may" for potential occurrences. ```suggestion Apollo Server 4 and 5 support incremental delivery directives such as <code>@defer</code> and <code>@stream</code> when combined with pre-release version <code>17.0.0-alpha.2</code> of <code>graphql-js</code>, and so the structure of <code>response.body</code> can represent either a single result or multiple results. <code>response.body.kind</code> is either <code>'single'</code> or <code>'incremental'</code>. If it is <code>'single'</code>, then incremental delivery has not been used, and <code>response.body.singleResult</code> is an object with <code>data</code>, <code>errors</code>, and <code>extensions</code> fields. If it is <code>'incremental'</code>, then <code>response.body.initialResult</code> is the initial result of the operation, and <code>response.body.subsequentResults</code> is an async iterator that yields subsequent results. (The precise structure of <code>initialResult</code> and <code>subsequentResults</code> is defined by <code>graphql-js</code> and might change between the current pre-release of <code>graphql-js</code> v17 and its final release; if you write code that processes these values before <code>graphql-js</code> v17 has been released you might need to adapt it when the API is finalized. Apollo Server currently only supports <code>17.0.0-alpha.2</code>, not newer alphas which use a different format.) ```

The `http` field contains an optional numeric `status` code and a `headers` map specifying any HTTP status code and headers that should be set.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/express-middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ api_reference: true

import TopLevelAwait from "../shared/top-level-await.mdx"

This API reference documents Apollo Server 4's [Express](https://expressjs.com/) integration, the `expressMiddleware` function.
This API reference documents Apollo Server's [Express](https://expressjs.com/) integration, the `expressMiddleware` function.

Apollo Server integrates with these Express versions through official integrations:
- [**Express v4**](https://www.npmjs.com/package/@as-integrations/express4): Install with `npm install @as-integrations/express4`
Expand All @@ -15,7 +15,7 @@ You must also install Express itself. Both packages export a function named `exp

<Note>

The Express v4 integration is also bundled in `@apollo/server` at `@apollo/server/express4`. While you can use this bundled version now, we recommend installing the separate package. Express v5 requires the separate package, and future Apollo Server versions will remove the bundled integration.
In Apollo Server 4, you can also import the Express v4 integration from `@apollo/server/express` without installing a second package. This does not support Express v5, and it was removed in Apollo Server 5. We recommend installing the separate package to make upgrading Apollo Server and Express easier.

</Note>

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/plugin/inline-trace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Using the plugin

> 📣 **New in Apollo Server 4**: error details are not included in traces by default. For more details, see [Error Handling](../../data/errors/#masking-and-logging-errors).
> 📣 **New since Apollo Server 4**: error details are not included in traces by default. For more details, see [Error Handling](../../data/errors/#masking-and-logging-errors).

Check notice on line 8 in docs/source/api/plugin/inline-trace.mdx

View check run for this annotation

Apollo Librarian / AI Style Review

docs/source/api/plugin/inline-trace.mdx#L8

Avoid using bold for emphasis. ```suggestion > 📣 New since Apollo Server 4: error details are not included in traces by default. For more details, see [Error Handling](../../data/errors/#masking-and-logging-errors). ```

This article documents the options for the `ApolloServerPluginInlineTrace` plugin, which you can import from `@apollo/server/plugin/inlineTrace`.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/plugin/landing-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

## Default non-production landing page

In non-production environments, Apollo Server 4's landing page is an embedded version of [Apollo Sandbox](/graphos/explorer/sandbox) (served at `http://localhost:4000` by default):
In non-production environments, Apollo Server's landing page is an embedded version of [Apollo Sandbox](/graphos/explorer/sandbox) (served at `http://localhost:4000` by default):

<img class="screenshot" src="../../images/sandbox.jpeg" alt="Apollo Sandbox" />

Expand Down Expand Up @@ -636,7 +636,7 @@

## GraphQL Playground landing page

By default, Apollo Server 2 provided a GraphQL Playground landing page. For migration purposes, we've published the [`@apollo/server-plugin-landing-page-graphql-playground`](https://www.npmjs.com/package/@apollo/server-plugin-landing-page-graphql-playground) package, a GraphQL Playground plugin compatible with Apollo Server 4. However, we aren't supporting this plugin with documentation or security updates since the GraphQL Playground project is officially [retired](https://github.com/graphql/graphql-playground/issues/1143) and we do not recommend its continued use. Instead, we recommend migrating to the actively maintained [Apollo Sandbox](/graphos/explorer/sandbox) (the default landing page in Apollo Server 4) at your earliest convenience.
By default, Apollo Server 2 provided a GraphQL Playground landing page. For migration purposes, we've published the [`@apollo/server-plugin-landing-page-graphql-playground`](https://www.npmjs.com/package/@apollo/server-plugin-landing-page-graphql-playground) package, a GraphQL Playground plugin compatible with Apollo Server. However, we aren't supporting this plugin with documentation or security updates since the GraphQL Playground project is officially [retired](https://github.com/graphql/graphql-playground/issues/1143) and we do not recommend its continued use. Instead, we recommend migrating to the actively maintained [Apollo Sandbox](/graphos/explorer/sandbox) (the default landing page in Apollo Server) at your earliest convenience.

Check notice on line 639 in docs/source/api/plugin/landing-pages.mdx

View check run for this annotation

Apollo Librarian / AI Style Review

docs/source/api/plugin/landing-pages.mdx#L639

Use "because" instead of "since" when explaining a reason, and use contractions for a more approachable tone. ```suggestion By default, Apollo Server 2 provided a GraphQL Playground landing page. For migration purposes, we've published the [<code>@apollo/server-plugin-landing-page-graphql-playground</code>](https://www.npmjs.com/package/@apollo/server-plugin-landing-page-graphql-playground) package, a GraphQL Playground plugin compatible with Apollo Server. However, we aren't supporting this plugin with documentation or security updates because the GraphQL Playground project is officially [retired](https://github.com/graphql/graphql-playground/issues/1143) and we don't recommend its continued use. Instead, we recommend migrating to the actively maintained [Apollo Sandbox](/graphos/explorer/sandbox) (the default landing page in Apollo Server) at your earliest convenience. ```

## Disabling the landing page

Expand Down
2 changes: 0 additions & 2 deletions docs/source/api/plugin/subscription-callback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ minVersion: 4.9.0

This document covers the usage of the subscription callback plugin for use in Apollo Federation with GraphOS Router. For more information about the protocol itself, see the [subscription callback protocol](/router/executing-operations/subscription-callback-protocol).

> ⚠️ **Note**: The subscription callback protocol is currently in [preview](/resources/product-launch-stages#preview). Breaking changes might be introduced during the preview period.

## Using the plugin

This article documents the options for the `ApolloServerPluginSubscriptionCallback` plugin, which you can import from `@apollo/server/plugin/subscriptionCallback`.
Expand Down
9 changes: 6 additions & 3 deletions docs/source/api/plugin/usage-reporting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
api_reference: true
---

> Sending metrics from Apollo Server to GraphOS requires an [Enterprise plan](https://www.apollographql.com/pricing).
> If your organization doesn't have an Enterprise plan, you can test out this functionality by signing up for a free [GraphOS trial](https://studio.apollographql.com/signup?referrer=docs-content).
<PlanRequired plans={["Free", "Developer", "Standard", "Enterprise"]}>

While Insights are available on all GraphOS plans, metrics retention varies by [plan](https://www.apollographql.com/pricing?referrer=docs-content).

</PlanRequired>

Apollo Server's built-in usage reporting plugin gathers data on how your clients use the operations and fields in your GraphQL schema. The plugin also handles pushing this usage data to [GraphOS](/graphos/), as described in [Metrics and logging](../../monitoring/metrics/).

This plugin is designed to be used in an Apollo Gateway or in a monolithic server; it is not designed to be used from a subgraph. In a supergraph running Apollo Federation, the Apollo Gateway or GraphOS Router will send usage reports to Apollo's cloud. Subgraphs don't need to also send usage reports to Apollo's cloud; instead, they send it to the Router via [inline traces](./inline-trace/) and the Router combines execution information across all subgraphs and sends summarized reports to the cloud.

## Default installation

> 📣 **New in Apollo Server 4**: error details are not included in traces by default. For more details, see [Error Handling](../../data/errors/#masking-and-logging-errors).
> 📣 **New since Apollo Server 4**: error details are not included in traces by default. For more details, see [Error Handling](../../data/errors/#masking-and-logging-errors).

Check notice on line 18 in docs/source/api/plugin/usage-reporting.mdx

View check run for this annotation

Apollo Librarian / AI Style Review

docs/source/api/plugin/usage-reporting.mdx#L18

Avoid using bold for emphasis. ```suggestion > 📣 New since Apollo Server 4: error details are not included in traces by default. For more details, see [Error Handling](../../data/errors/#masking-and-logging-errors). ```

Apollo Server automatically installs and enables this plugin with default settings if you [provide a graph API key and a graph ref to Apollo Server](../../monitoring/metrics/#sending-metrics-to-graphos) and your server is not a federated subgraph. You usually do this by setting the `APOLLO_KEY` and `APOLLO_GRAPH_REF` (or `APOLLO_GRAPH_ID` and `APOLLO_GRAPH_VARIANT`) environment variables. No other action is required.

Expand Down
Loading