Type parameters
Callable
ReactMutation
▸ ReactMutation(...args): Promise<FunctionReturnType<Mutation>>
Execute the mutation on the server, returning a Promise of its return value.
Parameters
Returns
Promise<FunctionReturnType<Mutation>>
The return value of the server-side function call.
Methods
withOptimisticUpdate
▸ withOptimisticUpdate<T>(optimisticUpdate): ReactMutation<Mutation>
Define an optimistic update to apply as part of this mutation.
This is a temporary update to the local query results to facilitate a
fast, interactive UI. It enables query results to update before a mutation
executed on the server.
When the mutation is invoked, the optimistic update will be applied.
Optimistic updates can also be used to temporarily remove queries from the
client and create loading experiences until a mutation completes and the
new query results are synced.
The update will be automatically rolled back when the mutation is fully
completed and queries have been updated.
Type parameters
Parameters
Returns
ReactMutation<Mutation>
A new ReactMutation with the update configured.