0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/react/reference/interfaces/MutationObserverLoadingResult.md
Wonsuk Choi 9dd4d7d506
docs(query-core/types): add JSDoc to the properties of the exported interfaces and type aliases (#11891)
* docs(query-core/types): add JSDoc to the properties of the exported interfaces and type aliases

* docs(query-core/types): mention mutations in the 'hydrate' default options description
2026-10-05 01:55:45 +09:00

4.1 KiB

id title
MutationObserverLoadingResult MutationObserverLoadingResult

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

A mutation result in the pending state while the mutation runs.

Extends

Type Parameters

TData

TData = unknown

TError

TError = DefaultError

TVariables

TVariables = void

TOnMutateResult

TOnMutateResult = unknown

Properties

Property Type Description Overrides
context TOnMutateResult | undefined The value returned by onMutate, if defined. Passed to onSuccess, onError and onSettled as the mutation's context. -
data undefined undefined, since the mutation hasn't succeeded. MutationObserverBaseResult.data
error null null, since the mutation hasn't failed. MutationObserverBaseResult.error
failureCount number The number of times the mutation function has failed for the current attempt. -
failureReason TError | null The reason the current attempt failed, as reported by the retryer. -
isError false false, since the mutation hasn't failed. MutationObserverBaseResult.isError
isIdle false false, since the mutation has run. MutationObserverBaseResult.isIdle
isPaused boolean Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same scope to finish. -
isPending true true, since the mutation is running. MutationObserverBaseResult.isPending
isSuccess false false, since the mutation hasn't succeeded. MutationObserverBaseResult.isSuccess
mutate MutateFunction<TData, TError, TVariables, TOnMutateResult> 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 () => void A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). -
status "pending" 'pending', since the mutation is running. MutationObserverBaseResult.status
submittedAt number The timestamp for when the mutation was submitted. -
variables TVariables The variables passed to mutate for this mutation. MutationObserverBaseResult.variables