Cache class Null safety

Constructors

Cache({Store? store, DataIdResolver? dataIdFromObject, Map<String, TypePolicy> typePolicies = const {}, Map<String, Set<String>> possibleTypes = const {}, bool addTypename = true, Map<OperationRequest, Map<String, Map<String, dynamic>?>> seedOptimisticPatches = const {}})

Properties

addTypename bool
final
dataIdFromObject DataIdResolver?
final
hashCode int
The hash code for this object.
read-onlyinherited
optimisticPatchesStream BehaviorSubject<Map<OperationRequest, Map<String, Map<String, dynamic>?>>?>
possibleTypes Map<String, Set<String>>
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
store Store
final
typePolicies Map<String, TypePolicy>
final

Methods

clear() → void
Removes all data from the store and from any optimistic patches.
dispose() Future<void>
evict(String entityId, {String? fieldName, Map<String, dynamic> args = const {}, OperationRequest? optimisticRequest}) → void
Removes the entity from the Store as well as from any optimistic patches.
gc() Set<String>
Removes all entities that cannot be reached from one of the root operations.
identify<TData>(TData data) String?
Returns the canonical ID for a given object or reference.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
optimisticReader(String dataId) Map<String, dynamic>?
Reads data for the given dataId from the Store, merging in any data from optimistic patches
readFragment<TData, TVars>(FragmentRequest<TData, TVars> request, {bool optimistic = true}) → TData?
Reads denormalized data from the Cache for the given fragment.
readQuery<TData, TVars>(OperationRequest<TData, TVars> request, {bool optimistic = true}) → TData?
Reads denormalized data from the Cache for the given operation.
release(String entityId) → void
Allows the entity to be garbage collected if it no longer has any references.
removeOptimisticPatch(OperationRequest request) → void
retain(String entityId) → void
Prevents the entity from being garbage collected.
toString() String
A string representation of this object.
inherited
watchFragment<TData, TVars>(FragmentRequest<TData, TVars> request, {bool optimistic = true}) Stream<TData?>
Watches for changes to data in the Cache for the given fragment.
watchQuery<TData, TVars>(OperationRequest<TData, TVars> request, {bool optimistic = true}) Stream<TData?>
Watches for changes to data in the Cache for the given operation.
writeFragment<TData, TVars>(FragmentRequest<TData, TVars> request, TData data, {OperationRequest? optimisticRequest}) → void
Normalizes data for the given fragment and writes it to the Store.
writeQuery<TData, TVars>(OperationRequest<TData, TVars> request, TData data, {OperationRequest? optimisticRequest}) → void
Normalizes data for the given operation and writes it to the Store.

Operators

operator ==(Object other) bool
The equality operator.
inherited