Skip to main content

Type Alias: MutationOptions<TData, TError, TVariables>

MutationOptions<TData, TError, TVariables>: Omit<UseMutationOptions<TData, TError, TVariables>, "mutationKey" | "mutationFn">

See Tanstack Query - useMutation options.

Type Parameters

Type ParameterDefault typeDescription
TDataunknownThe data returned.
TErrorunknownThe error returned.
TVariablesunknownThe variables used in the mutation.

See

Tanstack Query - useMutation

Example

useMutationHook({
mutation: {
onSuccess: (data, variables) => {
console.log('onSuccess callback', data, variables);
},
onError: (error) => {
console.log('onError callback', error);
},
},
})

Options

mutationKey and mutationFn are used internally and therefore not included as an options.

mutation: {
gcTime,
meta,
networkMode,
onError,
onMutate,
onSettled,
onSuccess,
retry,
retryDelay,
scope,
throwOnError,
}

Defined in

sdk-react-provider/src/lib/types.ts:173