injectMutation

Function: injectMutation()

ts
function injectMutation<TData, TError, TVariables, TContext>(
  optionsFn,
  injector?,
): CreateMutationResult<TData, TError, TVariables, TContext>
function injectMutation<TData, TError, TVariables, TContext>(
  optionsFn,
  injector?,
): CreateMutationResult<TData, TError, TVariables, TContext>

Injects a mutation: an imperative function that can be invoked which typically performs server side effects.

Unlike queries, mutations are not run automatically.

Type Parameters

TData = unknown

TError = Error

TVariables = void

TContext = unknown

Parameters

optionsFn

A function that returns mutation options.

injector?: Injector

The Angular injector to use.

Returns

CreateMutationResult<TData, TError, TVariables, TContext>

The mutation.

Defined in

inject-mutation.ts:38