ApolloStore
A wrapper around CacheManager that provides a simplified API for reading and writing data.
Although all operations are suspend functions, they may suspend or block the thread depending on the underlying cache implementation. For example, the SQL cache implementation on Android will block the thread while accessing the disk. As such, these operations must not run on the main thread. You can enclose them in a kotlinx.coroutines.withContext block with a Dispatchers.IO context to ensure that they run on a background thread.
Note that changes are not automatically published - pass publish = true or call publish to notify any watchers.
Properties
Functions
Direct access to the cache.
Perform garbage collection on the store.
Publishes a set of keys of record fields that have changed. This will notify watchers and any subscribers of changedKeys.
Reads a fragment from the store.
Reads an operation from the store.
Remove all dangling references in the store.
Removes a fragment from the store.
Removes an operation from the store.
Remove all stale fields in the store.
Remove all unreachable records in the store.
Rollbacks optimistic updates.
Trims the store if its size exceeds maxSizeBytes. The amount of data to remove is determined by trimFactor. The oldest records are removed according to their updated date.
Writes a fragment to the store.
Writes an operation to the store.
Writes an operation to the optimistic store.
Writes a fragment to the optimistic store.