Aller au contenu principal
Version : 11.x

Interface: UseTRPCMutationOptions<TInput, TError, TOutput, TContext>

Defined in: packages/react-query/src/shared/hooks/types.ts:154

Extends​

Type Parameters​

Type ParameterDefault type
TInput-
TError-
TOutput-
TContextunknown

Properties​

gcTime?​

optional gcTime: number

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1190

Inherited from​

UseMutationOptions.gcTime


meta?​

optional meta: Record<string, unknown>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1192

Inherited from​

UseMutationOptions.meta


mutationFn?​

optional mutationFn: MutationFunction<TOutput, TInput>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1181

Inherited from​

UseMutationOptions.mutationFn


mutationKey?​

optional mutationKey: readonly unknown[]

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1182

Inherited from​

UseMutationOptions.mutationKey


networkMode?​

optional networkMode: NetworkMode

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1189

Inherited from​

UseMutationOptions.networkMode


onError()?​

optional onError: (error, variables, context) => void | Promise<void>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1185

Parameters​

ParameterType
errorTError
variablesTInput
contextundefined | TContext

Returns​

void | Promise<void>

Inherited from​

UseMutationOptions.onError


onMutate()?​

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1183

Parameters​

ParameterType
variablesTInput

Returns​

undefined | TContext | Promise<undefined | TContext>

Inherited from​

UseMutationOptions.onMutate


onSettled()?​

optional onSettled: (data, error, variables, context) => void | Promise<void>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1186

Parameters​

ParameterType
dataundefined | TOutput
errornull | TError
variablesTInput
contextundefined | TContext

Returns​

void | Promise<void>

Inherited from​

UseMutationOptions.onSettled


onSuccess()?​

optional onSuccess: (data, variables, context) => void | Promise<void>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1184

Parameters​

ParameterType
dataTOutput
variablesTInput
contextTContext

Returns​

void | Promise<void>

Inherited from​

UseMutationOptions.onSuccess


retry?​

optional retry: RetryValue<TError>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1187

Inherited from​

UseMutationOptions.retry


retryDelay?​

optional retryDelay: RetryDelayValue<TError>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1188

Inherited from​

UseMutationOptions.retryDelay


scope?​

optional scope: MutationScope

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1193

Inherited from​

UseMutationOptions.scope


throwOnError?​

optional throwOnError: boolean | (error) => boolean

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:1196

Inherited from​

UseMutationOptions.throwOnError


trpc?​

optional trpc: TRPCReactRequestOptions

Defined in: packages/react-query/src/shared/hooks/types.ts:58

tRPC-related options

Inherited from​

TRPCUseQueryBaseOptions.trpc