Skip to content

Releases: apollographql/apollo-kotlin-normalized-cache

v1.0.0-alpha.7

14 Oct 10:26
@BoD BoD
2562bd0

Choose a tag to compare

  • Pagination API tweaks (#230)
    • Configuring connection fields with @typePolicy(connectionFields: "...") is deprecated. Instead, apply @connection to the connection types.
    • Configuring pagination arguments with @fieldPolicy(forField: "...", paginationArgs: "...") is deprecated. Instead, configure a FieldKeyGenerator on your cache.
    • The API of EmbeddedFieldsProvider has been tweaked to be called field by field, rather than by type.
  • @typePolicy and @fieldPolicy are now in the cache specification (#231)
    • After a deprecation period, they will be removed from the kotlin_labs specification. Here is how you should import these directives in your extra.graphqls:
      extend schema
      @link(url: "https://specs.apollo.dev/kotlin_labs/v0.5")
      @link(url: "https://specs.apollo.dev/cache/v0.3", import: ["@typePolicy", "@fieldPolicy"])

v1.0.0-alpha.6

21 Aug 17:30
@BoD BoD
6f1ead5

Choose a tag to compare

  • Rename allowCachedErrors -> serverErrorsAsCacheMisses and allowCachePartialResults -> throwOnCacheMiss (#214)

v1.0.0-alpha.5

04 Aug 08:20
@BoD BoD
afce56b

Choose a tag to compare

  • Add allowCachedPartialResults() and allowCachedErrors()(#205)
    These flags control whether partial results and errors should be returned from the cache. They are false by default.
  • Return existing cached values (e.g. Errors) in FieldPolicyCacheResolver (#198)
  • The compiler plugin's package name argument has been renamed com.apollographql.cache.packageName
    (was packageName) to avoid any collision with other plugins (#207)
    Using packageName still works, but is deprecated.
  • The cache() extension now stores received dates if max ages are configured (#199)
  • Expose metadata in cacheDumpProvider (#200)
  • Deprecate FetchPolicy.CacheAndNetwork (#205)
    This can be used instead: fetchPolicy(FetchPolicy.CacheOnly).toFlow().onCompletion { emitAll(fetchPolicy(FetchPolicy.NetworkOnly).toFlow()) }

v1.0.0-alpha.4

30 Jun 12:28
@BoD BoD
5ece1f1

Choose a tag to compare

  • Add browser JS support to normalized-cache-sqlite (#177)

    With this change, NormalizedCache/CacheManager/ApolloStore APIs are now suspend.

  • Add ApolloClient.Builder.cache() extension generation (#181)

    This generates a convenience cache() extension which configures the CacheKeyGenerator, MetadataGenerator, CacheResolver, and RecordMerger based
    on the type policies, connection types, and max ages configured in the schema:

    val apolloClient = ApolloClient.Builder()
        // ...
        .cache(cacheFactory = /*...*/)
        .build()
  • Add ability to control clock used for received and expiration dates, for tests (#189)

  • [Breaking] Disable optimistic updates by default (#190)

    To use optimistic updates, apps must now opt in, by passing enableOptimisticUpdates = true to the normalizedCache method. This was done as an optimization on native targets.

v1.0.0-alpha.3

06 Jun 14:38
b5cf6dd

Choose a tag to compare

With this release, the Normalized Cache requires Apollo Kotlin 4.3.0 or later.
This is necessary to ensure the cache compiler plugin can be used while other compiler plugins are also used.

  • Update Apollo compiler plugin to 4.3 API (#169)
  • Make deprecations less annoying (#163)
  • Don't assume presence of keyFields on @typePolicy (#162)
  • Bump sqldelight to 2.1.0 (#167)

v1.0.0-alpha.2

20 May 07:55
43800c7

Choose a tag to compare

  • The computation of cache keys when multiple key fields are used has changed to avoid potential collisions. Note: this can lead to cache misses after upgrading to this version. (#80)
  • Make SQL cache more robust. (#152)
  • Support simple list cases in FieldPolicyCacheResolver. (#142)
  • Fragments selecting the key fields are now automatically added for union members and interface possible types by the compiler plugin. (#141)
  • Introduce CacheKey.Scope. (#102)

v1.0.0-alpha.1

28 Apr 14:52
5b40dcb

Choose a tag to compare

  • Rename ApolloStore to CacheManager and SimpleApolloStore to ApolloStore. (#134)
  • Revert the ApolloClient.apolloStore deprecation - keeping the original name makes more sense now after the above rename. (#134)
  • Add ApolloStore.removeOperation() and ApolloStore.removeFragment(). (#135)

v0.0.9

09 Apr 17:38
db95600

Choose a tag to compare

Release 0.0.9 (#129)

  • Removing "incubating" from the repository and artifacts name. With a stable API on the horizon, now is a great time to try the library in your projects and give us feedback.
    The artifacts are now:

    • com.apollographql.cache:normalized-cache for the memory cache
    • com.apollographql.cache:normalized-cache-sqlite for the SQL cache.

    The package names are unchanged.

  • Records are now rooted per operation type (QUERY_ROOT, MUTATION_ROOT, SUBSCRIPTION_ROOT) (#109)

  • ApolloClient.apolloStore is deprecated in favor of ApolloClient.store for consistency. (#127)

  • ApolloClient.apolloStore now returns a SimpleApolloStore, a wrapper around ApolloStore that doesn't need a CustomScalarAdapters to be passed to read/write methods. (#123)

v0.0.8

28 Mar 15:08
3f6ebec

Choose a tag to compare

v0.0.8

  • Storage binary format is changed to be a bit more compact
  • Add ApolloStore.trim() to remove old data from the cache
  • CacheKey is used in more APIs instead of String, for consistency.
  • ApolloCacheHeaders.EVICT_AFTER_READ is removed. ApolloStore.remove() can be used instead.
  • NormalizedCache.remove(pattern: String) is removed. Please open an issue if you need this feature back.

v0.0.7

03 Mar 16:38
97283f2

Choose a tag to compare

  • Store errors in the cache, and remove storePartialResponses() (#96)