Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update caching docs to include federation support. #5536

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

mandiwise
Copy link
Contributor

This PR updates the docs page on caching to include directions on how to use the @cacheControl directive and AS3's new cache control features with federation. The related changes to federation will be merged into that repo with this PR:

apollographql/federation#870

Copy link
Member

@glasser glasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but let's not actually merge until the relevant software is released

@@ -292,6 +290,46 @@ query GetReaderBookTitle {
}
```

## Using with federation

When using [Apollo Federation](https://www.apollographql.com/docs/federation), the `@cacheControl` directive and `CacheControlScope` enum may be defined in a subgraph's schema. An Apollo Server-based subgraph will calculate and set the cache hint for the response that it sends to the gateway as it would for a non-federated Apollo Server sending a response to a client. The gateway will then calculate the cache hint for the overall response based on the most restrictive settings among all of the responses received from the subgraphs involved in query plan execution.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should merge this PR once the appropriate federation and gateway PRs are released, and we should include the minimum versions of federation and gateway required to support this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the minimum versions, do you think they should be included directly in the AS3 docs or in a new section in the federation docs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be great to have new docs on the federation site (or at least a link to here) — are you interested in writing them? I think we should also include here the minimum versions.

@glasser glasser merged commit e17ce39 into apollographql:main Aug 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants