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 a Gradle plugin for declarative cache control #43

Closed BoD closed 1 month ago

BoD commented 1 month ago

From the @CacheControl and @CacheControlField directives, will generate something like:

public object Cache {
  public val maxAges: Map<String, MaxAge> = mapOf(
    "Query.cachedBook" to MaxAge.Duration(60.seconds),
    "User" to MaxAge.Duration(10.seconds),
    "Reader.book" to MaxAge.Inherit,
  )
}

which can then be passed to ExpirationCacheResolver

BoD commented 1 month ago

Close in favor of #44