NormalizedCache
A provider of Record for reading requests from cache.
To serialize a Record to a standardized form use recordAdapter() which handles call custom scalar types registered on the ApolloClient
If a NormalizedCache cannot return all the records needed to read a response, it will be considered a cache miss.
A NormalizedCache is recommended to implement support for CacheHeaders specified in the cacheHeaders of merge .
A NormalizedCache can choose to store records in any manner.
Inheritors
Functions
Perform garbage collection on the cache.
Calls through to NormalizedCache.loadRecord. Implementations should override this method if the underlying storage technology can offer an optimized manner to read multiple records. There is no guarantee on the order of returned Record
Calls through to NormalizedCache.merge. Implementations should override this method if the underlying storage technology can offer an optimized manner to store multiple records.
Remove a record and potentially its referenced records from this cache and all chained caches
Calls through to NormalizedCache.remove. Implementations should override this method if the underlying storage technology can offer an optimized manner to remove multiple records.
Remove all dangling references in the cache. A field is a dangling reference if its value (or, for lists, any of its values) is a reference to a record that does not exist.
Remove all stale fields in the cache. A field is stale if its received date is older than its max age (configurable via maxAgeProvider) or if its expiration date has passed. A maximum staleness can be passed.
Remove all unreachable records in the cache. A record is unreachable if there exists no chain of references from the root record to it.
Returns the size in bytes of a Record. This is an optional operation that can be implemented by the caches for debug purposes, otherwise it defaults to -1, meaning unknown size.
Trims the cache 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.