useMutationJob<DataType, ErrorType, VariablesType, RecoveryType, ArgsType> function

Mutation<DataType, ErrorType, VariablesType> useMutationJob<DataType, ErrorType, VariablesType, RecoveryType, ArgsType>({
  1. required MutationJob<DataType, ErrorType, VariablesType, RecoveryType, ArgsType> job,
  2. MutationOnDataFn<DataType, RecoveryType>? onData,
  3. MutationOnErrorFn<ErrorType, RecoveryType>? onError,
  4. MutationOnMutationFn<VariablesType, RecoveryType>? onMutate,
  5. required ArgsType args,
  6. List<Object?>? keys,
})

Implementation

Mutation<DataType, ErrorType, VariablesType>
    useMutationJob<DataType, ErrorType, VariablesType, RecoveryType, ArgsType>({
  required MutationJob<DataType, ErrorType, VariablesType, RecoveryType,
          ArgsType>
      job,
  MutationOnDataFn<DataType, RecoveryType>? onData,
  MutationOnErrorFn<ErrorType, RecoveryType>? onError,
  MutationOnMutationFn<VariablesType, RecoveryType>? onMutate,
  required ArgsType args,
  List<Object?>? keys,
}) {
  return useMutation(
    job.mutationKey,
    (variables) => job.task(variables, args),
    retryConfig: job.retryConfig,
    onData: onData,
    onError: onError,
    onMutate: onMutate,
    refreshQueries: job.refreshQueries,
    refreshInfiniteQueries: job.refreshInfiniteQueries,
    keys: keys,
  );
}