Interface MutationObserverOptions<TData, TError, TVariables, TContext>

interface MutationObserverOptions<TData, TError, TVariables, TContext> {
    _defaulted?: boolean;
    gcTime?: number;
    meta?: Record<string, unknown>;
    mutationFn?: MutationFunction<TData, TVariables>;
    mutationKey?: MutationKey;
    networkMode?: NetworkMode;
    onError?: ((error: TError, variables: TVariables, context: undefined | TContext) => unknown);
    onMutate?: ((variables: TVariables) => undefined | TContext | Promise<undefined | TContext>);
    onSettled?: ((data: undefined | TData, error: null | TError, variables: TVariables, context: undefined | TContext) => unknown);
    onSuccess?: ((data: TData, variables: TVariables, context: TContext) => unknown);
    retry?: RetryValue<TError>;
    retryDelay?: RetryDelayValue<TError>;
    scope?: MutationScope;
    throwOnError?: boolean | ((error: TError) => boolean);
}

Type Parameters

  • TData = unknown
  • TError = DefaultError
  • TVariables = void
  • TContext = unknown

Hierarchy (view full)

Properties

_defaulted?: boolean
gcTime?: number
meta?: Record<string, unknown>
mutationKey?: MutationKey
networkMode?: NetworkMode
onError?: ((error: TError, variables: TVariables, context: undefined | TContext) => unknown)
onMutate?: ((variables: TVariables) => undefined | TContext | Promise<undefined | TContext>)
onSettled?: ((data: undefined | TData, error: null | TError, variables: TVariables, context: undefined | TContext) => unknown)
onSuccess?: ((data: TData, variables: TVariables, context: TContext) => unknown)
retry?: RetryValue<TError>
retryDelay?: RetryDelayValue<TError>
throwOnError?: boolean | ((error: TError) => boolean)