Releases: apollographql/apollo-kotlin-normalized-cache
v1.0.0-beta.0
- Add a publish argument to
CacheManager/ApolloStorewrite operations (#265) - Add
ReadOnlyNormalizedCache.sizeOfRecord(#118) - Disallow the same db file name to be used multiple times at the same time (#139)
- Use a mutex in
MemoryCacheeven when there is nonextCache(#259) - Default to a 4 MiB cursor window size (#268)
- Add some pagination validation (#261)
- Don't crash when encountering unknown fields (#258)
v1.0.0-alpha.8
- Database files are now stored in the
cachedirectory by default on Android (#164)
Note: if a cache in the previous location exists, it will be used, ensuring data is not lost when upgrading to this version. FieldPolicyCacheResolvernow uses thefieldPoliciespassed to its constructor instead of the information fromCompiledField. This allows to better isolate the main Apollo Kotlin project from the cache project. (#250)
If your code was callingFieldPolicyCacheResolver()directly, update it to passCache.fieldPoliciesto the constructor.- Rename
IdCacheKeyResolvertoIdCacheResolver, and keep the list ids and single id arguments in the same list. (#250) - Introduce
KeyArgumentsCacheResolverto programmatically provide key arguments (to use when@fieldPolicyis not suitable or desired) (#250) - Un-deprecate
FetchPolicy.CacheAndNetwork(#253)
See apollographql/apollo-kotlin#6772 for more context. - Treat parse errors from the cache as cache misses (#255)
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)