apollographql / apollo-kotlin-normalized-cache-incubating

Apollo Kotlin Incubating Normalized Cache
https://apollographql.github.io/apollo-kotlin-normalized-cache-incubating/
MIT License
5 stars 1 forks source link

Add CacheInfo.isStale #53

Closed BoD closed 1 week ago

BoD commented 2 weeks ago

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