UNPKG

@sparklink-pro/apant

Version:

Apollo & Antd tools

30 lines 1.48 kB
import { useMutation } from '@apollo/client'; import { DocumentNode, FragmentDefinitionNode } from 'graphql'; import { GraphQLFragmentType } from '../definitions'; /** * Extract fragments definition from a GraphQL query */ export declare const getFragments: (query: DocumentNode) => FragmentDefinitionNode[]; /** * Replace one or more fragments from the specified GraphQL query * * @param query The query object to update * @param fragments {string|array|object} The fragments to replace *'TypedDocumentNode<any, OperationVariables>': kind, definitions * @return {object} The updated query object */ export declare const replaceFragments: (query: DocumentNode, fragments: GraphQLFragmentType) => DocumentNode; export type useMutationParameters = Parameters<typeof useMutation>; export declare const parseMutation: (mutation: DocumentNode | import("@graphql-typed-document-node/core").TypedDocumentNode<unknown, unknown>, options?: import("@apollo/client").MutationHookOptions<unknown, unknown, unknown, import("@apollo/client").ApolloCache<any>> | undefined) => { mutate: (...a: any) => Promise<import("@apollo/client").FetchResult<unknown>>; data?: unknown; error?: import("@apollo/client").ApolloError | undefined; loading: boolean; called: boolean; client: import("@apollo/client").ApolloClient<object>; reset(): void; }; export declare function m<A, B extends Object>(param: [A, B]): { mutate: A; } & B; //# sourceMappingURL=gql.d.ts.map