Skip to content

Introduce connectors support to response caching#9171

Draft
andrewmcgivery wants to merge 10 commits intodevfrom
am/connectors_entity_batching
Draft

Introduce connectors support to response caching#9171
andrewmcgivery wants to merge 10 commits intodevfrom
am/connectors_entity_batching

Conversation

@andrewmcgivery
Copy link
Copy Markdown
Contributor

@andrewmcgivery andrewmcgivery commented Apr 10, 2026

This PR updates Response Caching to support connectors.

A key thing to understand about the design of this PR is that it is handled as two different steps in 2 different service layers: ConnectorService and ConnectorRequestService.

The reason why is because in order to support partial cache hits on batch entity requests, we have to modify the list of entity ids before the batch http request was constructed, meaning we have to do logic in ConnectorService.

So as a result, there is logic spread across both services.

Additionally, I had to implement a custom de-serializer for the invalidation endpoint because of wanting to support a combination of both subgraph and connector specific attributes on the incoming JSON object.

None Cached Request Cache Debugger:
image
image
image

Cached Request Cache Debugger:
image
image
image

Invalidating by cache tag:

curl --request POST \
        --header 'authorization: my-secret-key' \
        --header 'content-type: application/json' \
        --url http://localhost:4000/invalidation \
        --data '[{"kind":"cache_tag","sources":["connector-graph.random_person_api"],"cache_tag":"test-1"}]'
{"count":1}%      
image

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Apr 10, 2026

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 6 changed, 0 removed
* graphos/routing/(latest)/performance/caching/response-caching/customization.mdx
* graphos/routing/(latest)/performance/caching/response-caching/faq.mdx
* graphos/routing/(latest)/performance/caching/response-caching/invalidation.mdx
* graphos/routing/(latest)/performance/caching/response-caching/observability.mdx
* graphos/routing/(latest)/performance/caching/response-caching/overview.mdx
* graphos/routing/(latest)/performance/caching/response-caching/quickstart.mdx

Build ID: 107f4aada84b00e0476c4022
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/107f4aada84b00e0476c4022


⚠️ AI Style Review — 25 Issues Found

Summary

This pull request updates the documentation to align with style guide standards. Key changes include reframing instructions to be reader-centric and imperative, treating Apollo Connectors as a plural subject, and adopting an authoritative, opinionated voice for recommendations. Structural updates involve converting conceptual headings to gerunds or nouns, while linguistic refinements include using active voice, present tense, and code font for technical terms like localhost. Additionally, formatting was improved by removing non-descriptive link text, applying the Oxford comma, and eliminating unnecessary articles before product names.

Duration: 3079ms
Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@github-actions
Copy link
Copy Markdown
Contributor

@andrewmcgivery, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant