Skip to content
0

katanakit-js / MutationCacheConfig

Interface: MutationCacheConfig ​

Defined in: node_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/hydration-B9t5w6NC.d.ts:557

Global callbacks that fire for every mutation handled by a MutationCache, regardless of which component or observer triggered it. They differ from the defaultOptions provided to a QueryClient in two ways: defaultOptions can be overridden by each mutation, while these callbacks are always called, and onMutate here does not allow returning a result.

If a callback returns a promise, it will be awaited before the mutation continues.

Properties ​

PropertyTypeDescriptionDefined in
onError?(error, variables, onMutateResult, mutation, context) => unknownCalled when any mutation in the cache encounters an error.node_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/hydration-B9t5w6NC.d.ts:559
onMutate?(variables, mutation, context) => unknownCalled before any mutation in the cache executes.node_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/hydration-B9t5w6NC.d.ts:563
onSettled?(data, error, variables, onMutateResult, mutation, context) => unknownCalled when any mutation in the cache is settled, either successfully or with an error.node_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/hydration-B9t5w6NC.d.ts:565
onSuccess?(data, variables, onMutateResult, mutation, context) => unknownCalled when any mutation in the cache is successful.node_modules/.bun/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/hydration-B9t5w6NC.d.ts:561

Released under the MIT License.