Skip to content

Add CacheInfo.isStale #53

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

Merged
merged 7 commits into from
Oct 29, 2024
Merged

Add CacheInfo.isStale #53

merged 7 commits into from
Oct 29, 2024

Conversation

BoD
Copy link
Collaborator

@BoD BoD commented Oct 18, 2024

Can be used to know if data was received from the cache even though it was stale (can happen when using maxStale).

To make this happen I had to change ApolloStore.readOperation() / readFragment() to allow it to return cache headers (breaking!).

CacheResolver.resolveField() can now also return cache headers (not breaking because it returns Any?).

In this PR also, rename ExpirationCacheResolver to CacheControlCacheResolver, and rename "Expiration" to "Cache control" in the documentation.

Fixes #51

@BoD BoD requested a review from martinbonnin as a code owner October 18, 2024 17:48
@BoD BoD merged commit 2ae0456 into main Oct 29, 2024
2 checks passed
@BoD BoD deleted the is-stale branch October 29, 2024 16:55
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.

Add ApolloResponse.isStale
1 participant