MutationCache class final

Owns mutation executions, serial scopes, and persistence events.

Constructors

MutationCache({GlobalMutationSuccess? onSuccess, GlobalMutationError? onError})
Creates a mutation cache with optional global callbacks.

Properties

all → Iterable<Mutation>
All mutations currently in the cache.
no setter
hashCode → int
The hash code for this object.
no setterinherited
onError → GlobalMutationError?
Callback invoked after any mutation fails.
final
onSuccess → GlobalMutationSuccess?
Callback invoked after any mutation succeeds.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

build<TData, TVariables, TOptimistic>(QueryClient client, MutationOptions<TData, TVariables, TOptimistic> options, {MutationState<TData, TVariables, TOptimistic>? state}) → Mutation<TData, TVariables, TOptimistic>
Creates and stores a mutation execution.
canRun(Mutation mutation) → bool
Whether mutation is first in its serial scope.
clear() → void
Removes every cached mutation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify(MutationCacheEvent event) → void
Sends event to current subscribers.
remove(Mutation mutation) → void
Removes and destroys mutation.
resumePaused(QueryClient client) → Future<void>
Continues all cached mutations paused by network or scope constraints.
subscribe(void listener(MutationCacheEvent event)) → QueryDispose
Subscribes to mutation cache events.
toString() → String
A string representation of this object.
inherited
waitUntilRunnable(QueryClient client, Mutation mutation) → Future<void>
Waits until mutation can run under scope and network constraints.

Operators

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