MutationConfig<T, V> class

Configuration options for a single mutation.

Constructors

MutationConfig({T optimisticUpdate(V variables, T? previousData)?, List<List<Object>> invalidateQueries = const [], void onSuccess(T data)?, void onError(Object error)?, Duration? timeout})
Creates a new MutationConfig instance.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
invalidateQueries List<List<Object>>
A list of query keys to invalidate after the mutation successfully completes. Invalidation will trigger a refetch of the associated queries.
final
onError → void Function(Object error)?
A callback function executed if the mutation encounters an error.
final
onSuccess → void Function(T data)?
A callback function executed when the mutation successfully completes.
final
optimisticUpdate → T Function(V variables, T? previousData)?
An optional function to optimistically update cached data before the mutation completes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration?
An optional timeout for the mutation's API call.
final

Methods

copyWith({Value<T Function(V variables, T? previousData)?>? optimisticUpdate, List<List<Object>>? invalidateQueries, Value<void Function(T data)?>? onSuccess, Value<void Function(Object error)?>? onError, Value<Duration?>? timeout}) MutationConfig<T, V>
Creates a copy of this MutationConfig with updated values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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