UNPKG

1.18 kBTypeScriptView Raw
1import ApolloClient from "apollo-client";
2import { GraphClient, MutationOptions, QueryOptions } from "../spi/graph/GraphClient";
3/**
4 * Implementation of GraphClient using Apollo Client.
5 */
6export declare class ApolloGraphClient implements GraphClient {
7 endpoint: string;
8 /**
9 * Configured Apollo Client instance subclasses can use directly
10 */
11 readonly client: ApolloClient<any>;
12 /**
13 * Create a new GraphClient
14 * @param endpoint GraphQL endpoint
15 * @param headers any special headers to use
16 */
17 constructor(endpoint: string, headers?: any);
18 query<T, Q>(options: QueryOptions<Q> | string): Promise<T>;
19 executeQueryFromFile<T, Q>(queryFile: string, variables?: Q, queryOptions?: any, current?: string): Promise<T>;
20 executeQuery<T, Q>(q: string, variables?: Q, queryOptions?: any): Promise<T>;
21 mutate<T, Q>(options: MutationOptions<Q> | string): Promise<T>;
22 executeMutationFromFile<T, Q>(mutationFile: string, variables?: Q, mutationOptions?: any, current?: string): Promise<T>;
23 executeMutation<T, Q>(m: string, variables?: Q, mutationOptions?: any): Promise<any>;
24}
25//# sourceMappingURL=ApolloGraphClient.d.ts.map
\No newline at end of file