onMutate property

OnMutate<TVariables, TOnMutateResult>? onMutate
final

Runs before the mutation function, when the mutation is submitted; its result is handed to onSuccess, onError and onSettled so an optimistic update can be rolled back. A returned future is awaited before the function runs; a throw fails the mutation without running the function. No default.

Implementation

final OnMutate<TVariables, TOnMutateResult>? onMutate;