Package-level declarations

Types

Link copied to clipboard
interface ApolloStore

ApolloStore exposes a thread-safe api to access a com.apollographql.apollo.cache.normalized.api.NormalizedCache.

Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

An interceptor that emits the response from the cache first, and then emits the response(s) from the network.

Link copied to clipboard

An interceptor that emits the response from the cache first, and if there was a cache miss, emits the response(s) from the network.

Link copied to clipboard
Link copied to clipboard

An interceptor that emits the response from the cache only.

Link copied to clipboard

True if this response comes from the cache, false if it comes from the network.

Link copied to clipboard

An interceptor that emits the response(s) from the network first, and if there was a network error, emits the response from the cache.

Link copied to clipboard

An interceptor that emits the response(s) from the network only.

Functions

Link copied to clipboard
fun ApolloStore(normalizedCacheFactory: NormalizedCacheFactory, cacheKeyGenerator: CacheKeyGenerator = TypePolicyCacheKeyGenerator, cacheResolver: CacheResolver = FieldPolicyCacheResolver): ApolloStore
Link copied to clipboard
Link copied to clipboard

Gets the result from the cache first and always fetch from the network. Use this to get an early cached result while also updating the network values.

Link copied to clipboard

Sets the initial FetchPolicy This only has effects for queries. Mutations and subscriptions always use FetchPolicy.NetworkOnly

Link copied to clipboard

Sets the initial FetchPolicy This only has effects for queries. Mutations and subscriptions always use FetchPolicy.NetworkOnly

Link copied to clipboard
@JvmName(name = "-logCacheMisses")
fun ApolloClient.Builder.logCacheMisses(log: (String) -> Unit = { println(it) }): ApolloClient.Builder
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "configureApolloClientBuilder")
fun ApolloClient.Builder.normalizedCache(normalizedCacheFactory: NormalizedCacheFactory, cacheKeyGenerator: CacheKeyGenerator = TypePolicyCacheKeyGenerator, cacheResolver: CacheResolver = FieldPolicyCacheResolver, writeToCacheAsynchronously: Boolean = false): ApolloClient.Builder

Configures an ApolloClient with a normalized cache.

Link copied to clipboard

Sets the optimistic updates to write to the cache while a query is pending.

Link copied to clipboard

Sets the FetchPolicy used when watching queries and a cache change has been published

Link copied to clipboard

Sets the FetchPolicy used when watching queries and a cache change has been published

Link copied to clipboard
fun ApolloClient.Builder.store(store: ApolloStore, writeToCacheAsynchronously: Boolean = false): ApolloClient.Builder
Link copied to clipboard
Link copied to clipboard
fun <T> MutableExecutionOptions<T>.storePartialResponses(storePartialResponses: Boolean): T
Link copied to clipboard
Link copied to clipboard

Gets initial response(s) then observes the cache for any changes.

fun <D : Query.Data> ApolloCall<D>.watch(data: D?): Flow<ApolloResponse<D>>

Observes the cache for the given data. Unlike watch, no initial request is executed on the network. The fetch policy set by fetchPolicy will be used.

Link copied to clipboard
fun <T> MutableExecutionOptions<T>.writeToCacheAsynchronously(writeToCacheAsynchronously: Boolean): T