Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Apollo Graphql Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-apollo-graphql-knowledge-patch-nevaberry-plugins)
---
name: apollo-graphql-knowledge-patch
description: Apollo GraphQL
version: null
license: MIT
metadata:
author: Nevaberry
---
# Apollo GraphQL compatibility
Load this skill when migrating or maintaining Apollo Client, Apollo Router,
Apollo Server, Connectors, or their integrations. Use the quick references below
for common changes and the topic files for complete configuration and API details.
Keep each reference's product and release qualifications with its guidance.
## Reference index
| Reference | Topics |
| --- | --- |
| [Client and React](references/client-react.md) | Migration, hooks, query lifecycles, typing, links, local state, cache policies, testing, rendering |
| [Router configuration and security](references/router-configuration-security.md) | Configuration upgrades, HTTP limits, traffic shaping, CORS, JWT, authorization, masking, deployment |
| [Connectors and extensions](references/connectors-extensions.md) | Connector mappings and specifications, coprocessors, context keys, Rhai, Rust plugin APIs |
| [Planning, execution, and demand](references/planning-execution-demand.md) | Validation, introspection, query planning, demand control, operation limits, result coercion |
| [Caching and persisted queries](references/caching-persisted-queries.md) | Response and entity caches, Redis, invalidation, Cache-Control, manifests, safelisting |
| [Subscriptions and transport](references/subscriptions-transport.md) | Shared subscriptions, WebSocket behavior, multipart delivery, uploads, compression |
| [Telemetry and observability](references/telemetry-observability.md) | Metric migration, exporters, tracing, selectors, logs, cardinality, diagnostics |
| [Server runtime](references/server-runtime.md) | Runtime requirements, integrations, HTTP behavior, validation, incremental protocols, plugins, landing pages |
## Breaking changes and deprecations
### Client migration and imports
The migration codemod requires a Node.js release that can load ES modules through
`require()`. Run the TypeScript and TSX parsers separately. Imports redirected to
`@apollo/client/v4-migration` contain migration instructions in their declarations
and throw if used at runtime.
```sh
npx @apollo/client-codemod-migrate-3-to-4 --parser ts --extensions ts src
npx @apollo/client-codemod-migrate-3-to-4 --parser tsx --extensions tsx src
```
Move top-level client `name` and `version` to `clientAwareness: { name, version }`.
Replace `connectToDevTools: true` with `devtools: { enabled: true }`.
Remove `typeDefs` from the client constructor and `canonizeResults` from query and
cache options. Previously canonicalized equal objects can have different references.
When replacing `setContext` with `SetContextLink`, swap the callback arguments to
`(prevContext, operation)`. The codemod leaves this change to you.
`ApolloLink.execute` now needs the initiating client as its third argument.
See [Client and React](references/client-react.md) for link, RxJS, and testing migrations.
### Client errors and promise results
Operation results use one `error` field; `ApolloError` is removed.
Use `CombinedGraphQLErrors.is(error)` or `CombinedProtocolErrors.is(error)` before
reading the matching class's `error.errors`. Network failures follow `errorPolicy`:
`"none"` rejects, `"all"` resolves with `result.error`, and `"ignore"` suppresses it.
Network failures yield `data: undefined` when the promise resolves.
Read `loading`, `networkStatus`, and `partial` from watched query results; promise
results from `client.query`, `refetch`, `reobserve`, `fetchMore`, and lazy execution
no longer contain them. A watched query delivers errors through `next(result)`
and stays subscribed so it can recover on refetch.
Replace `ServerError.result` with `JSON.parse(error.bodyText)` when response JSON
is needed, and handle parse failures because the body can contain non-JSON text.
Exceptions from `useMutation`'s `onCompleted` reject the mutate promise and bypass
the hook's `onError`; handle them where you await the mutation.
### Lazy queries and result tracking
Pass `variables` and `context` to `execute({ variables, context })`, and options
such as `fetchPolicy` to `useLazyQuery`. Calling `execute()` during render throws.
Unmounting or starting another execution aborts an in-flight lazy execution with
`AbortError` unless its promise was retained. The hook result reflects only the
most recent execution, even when an earlier retained promise later resolves.
```ts
const pending = execute({ variables: { id } }).retain();
const result = await pending;
```
The `ignoreResults` mutation option is deprecated. To avoid synchronizing a
mutation result with component state, get the client from `useApolloClient()`
and call `client.mutate({ mutation, variables })` directly.
### Router configuration and startup
Router 2 no longer applies major-version configuration migrations at startup.
Within the same major version, automatic YAML migrations apply from Router 2.2.0.
Preview and write upgrades explicitly; replace the old `--schema` flag with
`router config schema`.
```bash
router config upgrade --diff router.yaml
router config upgrade router.yaml > router.next.yaml
mv router.next.yaml router.yaml
router config schema
```
From Router 2.13.0, `OTEL_EXPORTER_OTLP_ENDPOINT`,
`OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, and `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`
prevent startup. Remove them and configure endpoints in Router YAML.
Invalid CORS values also prevent startup. See
[Router configuration and security](references/router-configuration-security.md).
### Router renamed settings and extension APIs
Use `response_cache` instead of `preview_response_cache` for stable response caching.
The deprecated `apollo.preview_entity_cache` plugin should be replaced with
`apollo.response_cache`, with only one cache plugin enabled at a time.
Rename `persisted_queries.experimental_local_manifests` to
`persisted_queries.local_manifests` and `connectors.subgraphs` to `connectors.sources`.
Remove `traffic_shaping.deduplicate_variables`; variable deduplication is always
enabled. Router request limits move under `limits.router`, including
`limits.router.http2_max_headers_list_bytes`.
Migrate renamed context keys in Rust plugins, Rhai, coprocessors, and telemetry.
`context: true` and `context: deprecated` have deprecation warnings; use
`context: all` or a selective list of current keys. The Router constructs the
`tower::Service` pipeline once and clones it per request, so put per-request
initialization in request handling. See [Connectors and extensions](references/connectors-extensions.md).
### Telemetry migration
Replace removed HTTP counters and timers with `http.server.request.duration`
for inbound requests and `http.client.request.duration` for subgraph requests.
Use histogram counts for request totals. Replace active-session monitoring with
`http.server.active_requests`; enable it manually when
`telemetry.instrumentation.instruments.default_requirement_level` is `none`.
Replace bare string attributes with the object `static` form. Attributes under
`telemetry.instrumentation.spans.http_client` cannot use conditions or the
`static` selector: those configurations prevent startup.
Views that omit `aggregation` preserve the native aggregation; set it explicitly
if an existing dashboard requires histogram output. Full replacements and
exporter settings are in [Telemetry and observability](references/telemetry-observability.md).
### Server runtime and integration upgrades
Server 4 reached end of life on January 26, 2026. Before upgrading to Server 5,
use Node.js 20.0.0 or later and `graphql` at least 16.11.0.
Move `expressMiddleware` from `@apollo/server/express4` to
`@as-integrations/express4`; use `@as-integrations/express5` for Express 5.
Both integration packages also work with Server 4.
Server 5 reporting and subscription callback plugins default to Node.js `fetch`.
Update proxy configuration or explicitly supply `node-fetch` through `fetcher`.
`startStandaloneServer` uses Node's HTTP server directly; use `expressMiddleware`
if you depend on Express-specific request or response behavior.
Variable coercion errors return HTTP 400 by default in Server 5. Set
`status400ForVariableCoercionErrors: false` to preserve Server 4's HTTP 200 behavior.
From Server 4.6.0, setting the option to `true` lets clients and monitoring test
HTTP 400 before upgrading; the option is planned for removal in a future major.
See [Server runtime](references/server-runtime.md) for proxy and HTTP details.
## Frequently used features and behavior
### Incremental delivery and fragments
Configure `Defer20220824Handler` for the `@defer` wire format used in Client v3
and for Router. Use `GraphQL17Alpha9Handler` with a server implementing the
GraphQL.js 17 alpha 9 wire format. Custom multipart `fetch` implementations
must return a WHATWG `ReadableStream` as `Response.body`.
Apollo Server 5.0.0's experimental incremental delivery requires exactly
`graphql@17.0.0-alpha.2`. Server 5.1.0 uses `graphql@17.0.0-alpha.9` and
`Accept: multipart/mixed; incrementalSpec=v0.2`. From Server 5.2.0, legacy
`deferSpec=20220824` requests require the explicit `legacyExperimentalExecuteIncrementally`
option using `legacyExecuteIncrementally` from `@yaacovcr/transform`.
`useSuspenseFragment` suspends until all requested fragment fields are cached.
From Client 4.3.5, pass `variables` to `useFragment` when the fragment requires them,
as with `useSuspenseFragment`. During deferred delivery, queries keep `loading: true`
and report `NetworkStatus.streaming`; `dataState === "streaming"` identifies that phase.
### Query typing and refetch control
Declare configured `errorPolicy` and `returnPartialData` defaults with
`ApolloClient.DeclareDefaultOptions`. A required declared property opts into
modern signatures and requires its value in constructor `defaultOptions`.
Set `TypeOverrides.signatureStyle` to `"modern"` to opt in without a required
default; modern signatures reject explicit type arguments.
Register sources with `RefetchEventManager` for focus or reconnect refetching.
Control events with `refetchOn` as a boolean, predicate, or event map; a per-query
map inherits watch-query defaults for omitted events. A query created with
`skip: true` can be refetched by document before its first hook execution when
its required variables are supplied in the hook options. Queries initialized
with `skipToken` or `useLazyQuery` are excluded until their first execution.
### Cache behavior and invalidation
In Router response and entity caches, `no-store` permits hits and prevents writes;
`no-cache` bypasses lookups and permits writes. When the response cache would set
a merged `Cache-Control` header, any GraphQL errors make it `no-store`.
Each enabled response-cache subgraph needs Redis settings at startup.
Invalidation indexes for `subgraph`, `type`, and `cache_tag` default to enabled.
Disabling an index skips its Redis writes and makes that kind of invalidation
return HTTP 400 for the affected subgraph. Enabling one covers new entries;
clear the affected namespace first if it must cover the whole cache immediately.
See [Caching and persisted queries](references/caching-persisted-queries.md).
### Router limits, demand control, and subscriptions
Use experimental cooperative planning cancellation in `measure` mode before
`enforce`. Its memory limit requires Unix builds with `global-allocator` enabled
and `dhat-heap` disabled. Per-subgraph demand control in `enforce` mode skips an
over-budget subgraph and composes the response as though it returned null while
continuing the rest of the operation, if the global limit passed.
`limits.router.max_recursive_selections` caps selections after fragment expansion
and defaults to 10,000,000. Server's separate `maxRecursiveSelections` rule is off
by default. See [Planning, execution, and demand](references/planning-execution-demand.md).
Use subscription `ignore_auth_context: true` only where events are independent of
JWT claims. `subscription.max_lifetime` closes subscriptions with
`SUBSCRIPTION_MAX_LIFETIME_EXCEEDED`; omitting it leaves lifetime unlimited.
See [Subscriptions and transport](references/subscriptions-transport.md).
### Connector mappings and sensitive headers
Link to `connect/v0.4` to enable that spec. Primitive tokens after a colon are
literal values; prefix quoted input keys with `$.` when a mapping must read them.
`connect-migrate analyze` reports automatic rewrites and cases needing review.
Requestless `@connect` fields omit `http` and cannot reference the response body,
`$status`, or `$response` in their mappings.
Router header masking defaults to enabled for sensitive headers. Connectors
inherit their parent subgraph's rules; the shared `http_client` layer uses global
rules. Values copied into a coprocessor body or context remain visible in its debug
logs. Header selectors can force `redact: mask` or `redact: allow`.