Beignet API reference
    Preparing search index...

    Type Alias ContractUseMutationOptions<TContract, TProvidedHeaders>

    ContractUseMutationOptions: Omit<
        UseMutationOptions<
            InferSuccessResponse<TContract>,
            InferEndpointContractError<TContract>,
            EndpointCallArgs<TContract, TProvidedHeaders>,
            unknown,
        >,
        "mutationFn",
    > & {
        invalidates?: (
            data: InferSuccessResponse<TContract>,
            variables: EndpointCallArgs<TContract, TProvidedHeaders>,
        ) =>
            | readonly InvalidateQueryFilters<QueryKey>[]
            | Promise<readonly InvalidateQueryFilters<QueryKey>[]>;
    }

    Options accepted by ReactQueryContractHelper.mutationOptions(...).

    TanStack mutationFn is generated from the contract endpoint, so callers pass the normal TanStack mutation lifecycle options.

    Type Parameters

    Type Declaration

    • Optionalinvalidates?: (
          data: InferSuccessResponse<TContract>,
          variables: EndpointCallArgs<TContract, TProvidedHeaders>,
      ) =>
          | readonly InvalidateQueryFilters<QueryKey>[]
          | Promise<readonly InvalidateQueryFilters<QueryKey>[]>

      Queries to invalidate after a successful mutation and its onSuccess callback. Uses the executing mutation's QueryClient and awaits all invalidations.