Interface MutationOptions<TData, TError, TVariables, TContext>

Type Parameters

  • TData = unknown

  • TError = unknown

  • TVariables = void

  • TContext = unknown

Hierarchy

Properties

_defaulted?: boolean
cacheTime?: number
mutationFn?: MutationFunction<TData, TVariables>
mutationKey?: MutationKey
networkMode?: NetworkMode
onError?: ((error, variables, context) => unknown)

Type declaration

    • (error, variables, context): unknown
    • Parameters

      • error: TError
      • variables: TVariables
      • context: undefined | TContext

      Returns unknown

onMutate?: ((variables) => undefined | TContext | Promise<undefined | TContext>)

Type declaration

    • (variables): undefined | TContext | Promise<undefined | TContext>
    • Parameters

      • variables: TVariables

      Returns undefined | TContext | Promise<undefined | TContext>

onSettled?: ((data, error, variables, context) => unknown)

Type declaration

    • (data, error, variables, context): unknown
    • Parameters

      • data: undefined | TData
      • error: null | TError
      • variables: TVariables
      • context: undefined | TContext

      Returns unknown

onSuccess?: ((data, variables, context) => unknown)

Type declaration

    • (data, variables, context): unknown
    • Parameters

      • data: TData
      • variables: TVariables
      • context: undefined | TContext

      Returns unknown

retry?: RetryValue<TError>
retryDelay?: RetryDelayValue<TError>
variables?: TVariables