Interface Props<TRequestSchema, TResponseSchema>

Props for withRpcMutation method.

Same as withMutation.Props but without useCallback property.

interface Props<TRequestSchema, TResponseSchema> {
    key: MutationKey;
    schema: {
        request: TRequestSchema;
        response: TResponseSchema;
    };
    invalidator?: ((props) => Promise<unknown>);
    defaultOptions?: Options<TRequestSchema, TResponseSchema>;
}

Type Parameters

  • TRequestSchema extends RequestSchema

    Request schema.

  • TResponseSchema extends ResponseSchema

    Response schema.

Hierarchy

Properties

key: MutationKey

Query key used to cache the result.

schema: {
    request: TRequestSchema;
    response: TResponseSchema;
}

Mutation schemas.

Type declaration

invalidator?: ((props) => Promise<unknown>)

Callback used to invalidate the query cache.

Type declaration

    • (props): Promise<unknown>
    • Parameters

      • props: Props

      Returns Promise<unknown>

defaultOptions?: Options<TRequestSchema, TResponseSchema>

Default options for the mutation.