Package com.apollographql.apollo3.cache.normalized.api

Types

Link copied to clipboard
object ApolloCacheHeaders

A collection of cache headers that Apollo's implementations of NormalizedCache respect.

Link copied to clipboard
class CacheHeaders

A key/value collection which is sent with Record from a Operation to the NormalizedCache.

Link copied to clipboard
class CacheKey(val key: String)

A CacheKey identifies an object in the cache.

Link copied to clipboard
interface CacheKeyGenerator

An CacheKeyGenerator is responsible for finding an id for a given object

Link copied to clipboard
class CacheKeyGeneratorContext(val field: CompiledField, val variables: Executable.Variables)

The context in which an object is normalized.

Link copied to clipboard
abstract class CacheKeyResolver : CacheResolver

A CacheResolver that resolves objects and list of objects and fallbacks to the default resolver for scalar fields. It is intended to simplify the usage of CacheResolver when no special handling is needed for scalar fields.

Link copied to clipboard
interface CacheResolver

An interface for CacheResolver used to read the cache

Link copied to clipboard
object DefaultCacheResolver : CacheResolver

A cache resolver that uses the parent to resolve fields.

Link copied to clipboard
class ExpireDateCacheResolver : CacheResolver

A cache resolver that uses the cache date as an expiration date and expires past it

Link copied to clipboard
object FieldPolicyCacheResolver : CacheResolver

A CacheResolver that uses @fieldPolicy annotations to resolve fields and delegates to DefaultCacheResolver else

Link copied to clipboard
class MemoryCache(maxSizeBytes: Int = Int.MAX_VALUE, expireAfterMillis: Long = -1) : NormalizedCache

Memory (multiplatform) cache implementation based on recently used property (LRU).

Link copied to clipboard
class MemoryCacheFactory @JvmOverloads constructor(maxSizeBytes: Int = Int.MAX_VALUE, expireAfterMillis: Long = -1) : NormalizedCacheFactory
Link copied to clipboard
abstract class NormalizedCache : ReadOnlyNormalizedCache

A provider of Record for reading requests from cache.

Link copied to clipboard
abstract class NormalizedCacheFactory

A Factory used to construct an instance of a NormalizedCache configured with the custom scalar adapters set in ApolloClient.Builder#addCustomScalarAdapter(ScalarType, CustomScalarAdapter).

Link copied to clipboard
interface ReadOnlyNormalizedCache
Link copied to clipboard
class ReceiveDateCacheResolver(maxAge: Int) : CacheResolver

A cache resolver that uses the cache date as a receive date and expires after a fixed max age

Link copied to clipboard
class Record(    val key: String,     val fields: Map<String, Any?>,     val mutationId: Uuid? = null) : Map<String, Any?>

A normalized entry that corresponds to a response object. Object fields are stored if they are a GraphQL Scalars. If a field is a GraphQL Object a CacheKey will be stored instead.

Link copied to clipboard
Link copied to clipboard
object TypePolicyCacheKeyGenerator : CacheKeyGenerator

A CacheKeyGenerator that uses annotations to compute the id

Functions

Link copied to clipboard
fun Collection<Record>?.dependentKeys(): Set<String>
Link copied to clipboard
fun <D : Operation.Data> Operation<D>.normalize(    data: D,     customScalarAdapters: CustomScalarAdapters,     cacheKeyGenerator: CacheKeyGenerator): Map<String, Record>
fun <D : Executable.Data> Executable<D>.normalize(    data: D,     customScalarAdapters: CustomScalarAdapters,     cacheKeyGenerator: CacheKeyGenerator,     rootKey: String): Map<String, Record>
Link copied to clipboard
fun <D : Executable.Data> Executable<D>.readDataFromCache(    customScalarAdapters: CustomScalarAdapters,     cache: ReadOnlyNormalizedCache,     cacheResolver: CacheResolver,     cacheHeaders: CacheHeaders): D
fun <D : Fragment.Data> Fragment<D>.readDataFromCache(    cacheKey: CacheKey,     customScalarAdapters: CustomScalarAdapters,     cache: ReadOnlyNormalizedCache,     cacheResolver: CacheResolver,     cacheHeaders: CacheHeaders): D