CacheKeyResolver
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.
Override cacheKeyForField to compute a cache key for a field of composite type. Override listOfCacheKeysForField to compute a list of cache keys for a field of 'list-of-composite' type.
For simplicity, this only handles one level of list. Implement CacheResolver if you need arbitrary nested lists of objects.
Constructors
Functions
Link copied to clipboard
abstract fun cacheKeyForField(field: CompiledField, variables: Executable.Variables): CacheKey?
Content copied to clipboard
Return the computed the cache key for a composite field.
Link copied to clipboard
open fun listOfCacheKeysForField(field: CompiledField, variables: Executable.Variables): List<CacheKey?>?
Content copied to clipboard
Link copied to clipboard
override fun resolveField( field: CompiledField, variables: Executable.Variables, parent: Map<String, @JvmSuppressWildcards Any?>, parentId: String): Any?
Content copied to clipboard
Resolves a field from the cache. Called when reading from the cache, usually before a network request.