Type alias MutationConfig<Data, Error, Variables>

MutationConfig<Data, Error, Variables>: {
    onError?: UseMutationOptions<Data, Error, Variables>["onError"];
    onMutate?: UseMutationOptions<Data, Error, Variables>["onMutate"];
    onSettled?: UseMutationOptions<Data, Error, Variables>["onSettled"];
    onSuccess?: UseMutationOptions<Data, Error, Variables>["onSuccess"];
}

Type Parameters

  • Data

  • Error

  • Variables = void

Type declaration

  • Optional onError?: UseMutationOptions<Data, Error, Variables>["onError"]

    Function fires if mutation encounters error

  • Optional onMutate?: UseMutationOptions<Data, Error, Variables>["onMutate"]

    Function fires before mutation function and is passed same variables mutation function would receive. Value returned from this function will be passed to both onError and onSettled functions in event of a mutation failure.

  • Optional onSettled?: UseMutationOptions<Data, Error, Variables>["onSettled"]

    Function fires when mutation is either successfully fetched or encounters error

  • Optional onSuccess?: UseMutationOptions<Data, Error, Variables>["onSuccess"]

    Function fires when mutation is successful and will be passed the mutation's result

Generated using TypeDoc