Releases: apollographql/apollo-kotlin-normalized-cache
v1.0.0-alpha.7
- Pagination API tweaks (#230)
- Configuring connection fields with
@typePolicy(connectionFields: "...")is deprecated. Instead, apply@connectionto the connection types. - Configuring pagination arguments with
@fieldPolicy(forField: "...", paginationArgs: "...")is deprecated. Instead, configure aFieldKeyGeneratoron your cache. - The API of
EmbeddedFieldsProviderhas been tweaked to be called field by field, rather than by type.
- Configuring connection fields with
@typePolicyand@fieldPolicyare now in thecachespecification (#231)- After a deprecation period, they will be removed from the
kotlin_labsspecification. Here is how you should import these directives in yourextra.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"])
- After a deprecation period, they will be removed from the
v1.0.0-alpha.6
- Rename
allowCachedErrors->serverErrorsAsCacheMissesandallowCachePartialResults->throwOnCacheMiss(#214)
v1.0.0-alpha.5
- Add
allowCachedPartialResults()andallowCachedErrors()(#205)
These flags control whether partial results and errors should be returned from the cache. They arefalseby 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
(waspackageName) to avoid any collision with other plugins (#207)
UsingpackageNamestill 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
-
Add browser JS support to
normalized-cache-sqlite(#177)With this change,
NormalizedCache/CacheManager/ApolloStoreAPIs are nowsuspend. -
Add
ApolloClient.Builder.cache()extension generation (#181)This generates a convenience
cache()extension which configures theCacheKeyGenerator,MetadataGenerator,CacheResolver, andRecordMergerbased
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 = trueto thenormalizedCachemethod. This was done as an optimization on native targets.
v1.0.0-alpha.3
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.
v1.0.0-alpha.2
- 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
v0.0.9
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-cachefor the memory cachecom.apollographql.cache:normalized-cache-sqlitefor the SQL cache.
The package names are unchanged.
-
Records are now rooted per operation type (QUERY_ROOT, MUTATION_ROOT, SUBSCRIPTION_ROOT) (#109)
-
ApolloClient.apolloStoreis deprecated in favor ofApolloClient.storefor consistency. (#127) -
ApolloClient.apolloStorenow returns aSimpleApolloStore, a wrapper aroundApolloStorethat doesn't need aCustomScalarAdaptersto be passed to read/write methods. (#123)
v0.0.8
v0.0.8
- Storage binary format is changed to be a bit more compact
- Add
ApolloStore.trim()to remove old data from the cache CacheKeyis used in more APIs instead ofString, for consistency.ApolloCacheHeaders.EVICT_AFTER_READis removed.ApolloStore.remove()can be used instead.NormalizedCache.remove(pattern: String)is removed. Please open an issue if you need this feature back.