Note: I'm not 100% sure whether this qualifies as a bug or an unsupported
feature — the documentation isn't clear on whether Response Caching is
intended to work with Apollo Connectors. The Connectors limitations page
lists "Entity caching" as unsupported, but that refers to the deprecated
entity-cache feature, not the current Response Caching feature. Filing as a
bug since it's the closest category; happy to have it reclassified.
Describe the bug
Apollo Router v2.17.0 Response Caching does not populate the cache for
Connector-sourced (@connect) responses, while it does cache responses
from a classic Apollo Server subgraph under an otherwise identical setup.
Minimal, self-contained reproduction repo: https://github.com/vjvista/graphql-connector-caching
To Reproduce
Full, runnable steps are in the reproduction repo's README:
👉 https://github.com/vjvista/graphql-connector-caching
In short:
- Clone the repo,
npm install, and add GraphOS credentials to .env
(Response Caching requires a GraphOS connection; free plan is fine).
- Start the mock REST origin (
npm run rest), then run the connector case:
npm run compose:connector && npm run up && bash scripts/check-cache.sh
- See the result: 0 keys written to Redis —
RESULT: NOT CACHED.
For the control case, repeat with only the subgraph type swapped
(npm run classic, npm run compose:classic) — that run writes keys to Redis
(RESULT: CACHED). Only the subgraph type differs between the two runs; the
router config, Redis, origin data, and Cache-Control header are identical.
Desktop (please complete the following information):
• OS: macOS (Darwin) — router runs in Docker ( redis:7-alpine ,
ghcr.io/apollographql/router:v2.17.0 )
• Version:
• Apollo Router v2.17.0
• Federation v2.12 , Connectors connect/v0.3
• Redis 7
• Node 24, @apollo/server 5.x, @apollo/subgraph 2.14.x
• rover 0.41.x
Describe the bug
Apollo Router v2.17.0 Response Caching does not populate the cache for
Connector-sourced (
@connect) responses, while it does cache responsesfrom a classic Apollo Server subgraph under an otherwise identical setup.
Minimal, self-contained reproduction repo: https://github.com/vjvista/graphql-connector-caching
To Reproduce
Full, runnable steps are in the reproduction repo's README:
👉 https://github.com/vjvista/graphql-connector-caching
In short:
npm install, and add GraphOS credentials to.env(Response Caching requires a GraphOS connection; free plan is fine).
npm run rest), then run the connector case:npm run compose:connector && npm run up && bash scripts/check-cache.shRESULT: NOT CACHED.For the control case, repeat with only the subgraph type swapped
(
npm run classic,npm run compose:classic) — that run writes keys to Redis(
RESULT: CACHED). Only the subgraph type differs between the two runs; therouter config, Redis, origin data, and
Cache-Controlheader are identical.Desktop (please complete the following information):
• OS: macOS (Darwin) — router runs in Docker ( redis:7-alpine ,
ghcr.io/apollographql/router:v2.17.0 )
• Version:
• Apollo Router v2.17.0
• Federation v2.12 , Connectors connect/v0.3
• Redis 7
• Node 24, @apollo/server 5.x, @apollo/subgraph 2.14.x
• rover 0.41.x