import type { TypedDocumentNode } from "@graphql-typed-document-node/core"; import type { QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; /** * Document-generic GraphQL hooks. The document IS the operation: no per-domain * hook modules. A document must select exactly one root field, and `data` is * that field's value directly (`Department[]`, `Department | null`, …) — no * response envelope to peel at every call site. Beyond the unwrap, nothing is * synthesized: a nullable field reaches the consumer as `null`, and errors are * the query/mutation error. */ export type GqlVariables = Record; /** * When the document has no required variables (none at all, or all optional), * the variables argument may be omitted; otherwise it is mandatory. */ type VarsArgs = Record extends TVars ? [variables?: TVars, options?: TOptions] : [variables: TVars, options?: TOptions]; /** * Canonical query key for a document: `[operationName]` or * `[operationName, variables]`. `undefined`-valued variables are stripped and * an empty variables object collapses to `[operationName]`, so the no-vars * form is a prefix of every vars variant — `invalidateQueries({ queryKey: * gqlQueryKey(DepartmentDocument) })` matches all cached ids. */ export declare function gqlQueryKey(document: TypedDocumentNode, variables?: TVars): QueryKey; export type GqlQueryOptions = Omit, "queryKey" | "queryFn">; export type GqlSuspenseQueryOptions = Omit, "queryKey" | "queryFn">; export type GqlMutationOptions = Omit, "mutationFn" | "mutationKey"> & { /** Query keys to invalidate on success — shorthand for `meta.invalidates`. */ invalidates?: QueryKey[]; }; export declare function useGqlQuery(document: TypedDocumentNode, TVars>, ...args: VarsArgs>): UseQueryResult; export declare function useGqlSuspenseQuery(document: TypedDocumentNode, TVars>, ...args: VarsArgs>): UseSuspenseQueryResult; export declare function useGqlMutation(document: TypedDocumentNode, TVars>, options?: GqlMutationOptions): UseMutationResult; export {}; //# sourceMappingURL=useGqlOperations.d.ts.map