Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "useMutation"

Index

Type aliases

MutationCallback

MutationCallback<TData, Mutation, TVariables>: (mutationArgs?: MutationCallbackArgs<Mutation, TData, TVariables>) => Promise<Maybe<TData>>

Mutation callback

Type parameters

Type declaration

MutationFn

MutationFn<TData, Mutation, TVariables>: (schema: Client<Mutation>["query"], variables: TVariables) => TData

Mutation function, it receives the mutation schema from gqless and the variables, if any.

It should return the data expected from the hook.

Type parameters

Type declaration

    • (schema: Client<Mutation>["query"], variables: TVariables): TData
    • Parameters

      • schema: Client<Mutation>["query"]
      • variables: TVariables

      Returns TData

UseMutation

UseMutation<Mutation>: <TData, TVariables>(mutationFn: MutationFn<TData, Mutation, TVariables>, options?: MutationOptions<TData, TVariables>) => [MutationCallback<TData, Mutation, TVariables>, UseMutationState<TData>]

useMutation hook

Type parameters

  • Mutation

Type declaration

Functions

Const createUseMutation

Generated using TypeDoc