Introduce connectors support to response caching#9171
Introduce connectors support to response caching#9171andrewmcgivery wants to merge 10 commits intodevfrom
Conversation
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 6 changed, 0 removedBuild ID: 107f4aada84b00e0476c4022 URL: https://www.apollographql.com/docs/deploy-preview/107f4aada84b00e0476c4022
|
|
@andrewmcgivery, please consider creating a changeset entry in |
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:



Cached Request Cache Debugger:



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}%Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
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. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
A lot of (if not most) features benefit from built-in observability and
debug-level logs. Please read this guidance on metrics best-practices. ↩Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩