Skip to main content

Type parameters

NameType
GeneratedSchemaobject
GeneratedSchema.mutationobject

Callable#

UseMutation<TData, TArgs>(mutationFn?: (mutation: GeneratedSchema["mutation"], args: TArgs) => TData, options?: UseMutationOptions<TData>): readonly [(...opts: undefined extends TArgs ? [object?] : [{ args: TArgs ; fn?: (mutation: GeneratedSchema["mutation"], args: TArgs) => TData }]) => Promise<TData>, UseMutationState<TData>]

Type parameters:#

NameDefault
TDataunknown
TArgsundefined

Parameters:#

NameType
mutationFn?(mutation: GeneratedSchema["mutation"], args: TArgs) => TData
options?UseMutationOptions<TData>

Returns: readonly [(...opts: undefined extends TArgs ? [object?] : [{ args: TArgs ; fn?: (mutation: GeneratedSchema["mutation"], args: TArgs) => TData }]) => Promise<TData>, UseMutationState<TData>]

Defined in: react/src/mutation/useMutation.ts:94

Last updated on by Sam Denty