Files
upstream-tanstack-query/docs/framework/angular/reference/interfaces/MutationObserverBaseResult.md
upstream-mirror 3a013ccdfe
Some checks failed
autofix.ci / autofix (push) Failing after 4s
Release / Release (push) Has been skipped
GitHub Actions Security Analysis / Run zizmor (push) Failing after 2s
snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:13:08 +05:00

6.8 KiB

id, title
id title
MutationObserverBaseResult MutationObserverBaseResult

Defined in: packages/query-core/src/types.ts:1335

The raw state stored on a Mutation instance. This is the underlying state that observer results (e.g. MutationObserverResult) are derived from.

Extends

Extended by

Type Parameters

TData

TData = unknown

TError

TError = DefaultError

TVariables

TVariables = void

TOnMutateResult

TOnMutateResult = unknown

Properties

context

context: TOnMutateResult | undefined;

Defined in: packages/query-core/src/mutation.ts:40

The value returned by onMutate, if defined. Passed to onSuccess, onError and onSettled as the mutation's context.

Inherited from

MutationState.context


data

data: TData | undefined;

Defined in: packages/query-core/src/types.ts:1344

The last successfully resolved data for the mutation.

Overrides

MutationState.data


error

error: TError | null;

Defined in: packages/query-core/src/types.ts:1353

The error object for the mutation, if an error was encountered.

  • Defaults to null.

Overrides

MutationState.error


failureCount

failureCount: number;

Defined in: packages/query-core/src/mutation.ts:53

The number of times the mutation function has failed for the current attempt.

Inherited from

MutationState.failureCount


failureReason

failureReason: TError | null;

Defined in: packages/query-core/src/mutation.ts:57

The reason the current attempt failed, as reported by the retryer.

Inherited from

MutationState.failureReason


isError

isError: boolean;

Defined in: packages/query-core/src/types.ts:1358

A boolean variable derived from status.

  • true if the last mutation attempt resulted in an error.

isIdle

isIdle: boolean;

Defined in: packages/query-core/src/types.ts:1363

A boolean variable derived from status.

  • true if the mutation is in its initial state prior to executing.

isPaused

isPaused: boolean;

Defined in: packages/query-core/src/mutation.ts:62

Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same scope to finish.

Inherited from

MutationState.isPaused


isPending

isPending: boolean;

Defined in: packages/query-core/src/types.ts:1368

A boolean variable derived from status.

  • true if the mutation is currently executing.

isSuccess

isSuccess: boolean;

Defined in: packages/query-core/src/types.ts:1373

A boolean variable derived from status.

  • true if the last mutation attempt was successful.

mutate

mutate: MutateFunction<TData, TError, TVariables, TOnMutateResult>;

Defined in: packages/query-core/src/types.ts:1393

The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.

Param

The variables object to pass to the mutationFn.

Param

This function will fire when the mutation is successful and will be passed the mutation's result.

Param

This function will fire if the mutation encounters an error and will be passed the error.

Param

This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.

Remarks

  • If you make multiple requests, onSuccess will fire only after the latest call you've made.
  • All the callback functions (onSuccess, onError, onSettled) are void functions, and the returned value will be ignored.

reset()

reset: () => void;

Defined in: packages/query-core/src/types.ts:1397

A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).

Returns

void


status

status: MutationStatus;

Defined in: packages/query-core/src/types.ts:1382

The status of the mutation.

  • Will be:
    • idle initial status prior to the mutation function executing.
    • pending if the mutation is currently executing.
    • error if the last mutation attempt resulted in an error.
    • success if the last mutation attempt was successful.

Overrides

MutationState.status


submittedAt

submittedAt: number;

Defined in: packages/query-core/src/mutation.ts:74

The timestamp for when the mutation was submitted.

Inherited from

MutationState.submittedAt


variables

variables: TVariables | undefined;

Defined in: packages/query-core/src/types.ts:1348

The variables object passed to the mutationFn.

Overrides

MutationState.variables