import { type EventCallable, type Store } from "effector"; import type { ApolloClient, DefaultContext, DocumentNode, MaybeMasked, OperationVariables, TypedDocumentNode } from "@apollo/client"; import { type Optional } from "../lib/optional.js"; import { type RemoteOperation, type RemoteOperationInternals } from "../remote_operation.js"; interface CreateMutationOptions { /** Your Apollo Client instance that'll be used for making the mutation. */ client: ApolloClient | Store>; /** * A GraphQL Document with a single `mutation` for your operation. * It's passed directly to Apollo with no modifications. */ document: DocumentNode | TypedDocumentNode; /** Context passed to your Apollo Link. */ context?: DefaultContext | Store; name?: string; } export type MutationMeta = void; type MutationInternals = RemoteOperationInternals, Variables, MutationMeta>; export interface Mutation extends RemoteOperation, Variables, MutationMeta> { /** Run this Mutation against the GraphQL server. */ start: EventCallable>; meta: { name: string; client: Store>; document: TypedDocumentNode; }; /** * Internal tools, useful for testing. */ __: MutationInternals; } export declare function createMutation({ client, document, context, name, }: CreateMutationOptions): Mutation; export {};