createMutation

Function: createMutation()

ts
function createMutation<TData, TError, TVariables, TContext>(options, queryClient?): CreateMutationResult<TData, TError, TVariables, TContext>;
function createMutation<TData, TError, TVariables, TContext>(options, queryClient?): CreateMutationResult<TData, TError, TVariables, TContext>;

Defined in: packages/svelte-query/src/createMutation.svelte.ts:17

Type Parameters

TData

TData = unknown

TError

TError = Error

TVariables

TVariables = void

TContext

TContext = unknown

Parameters

options

Accessor<CreateMutationOptions<TData, TError, TVariables, TContext>>

A function that returns mutation options

queryClient?

Accessor<QueryClient>

Custom query client which overrides provider

Returns

CreateMutationResult<TData, TError, TVariables, TContext>