UNPKG

847 BTypeScriptView Raw
1import { ApolloLink, Operation } from 'apollo-link';
2import { DocumentNode, ExecutionResult, GraphQLError } from 'graphql';
3export declare const VERSION = 1;
4export interface ErrorResponse {
5 graphQLErrors?: GraphQLError[];
6 networkError?: Error;
7 response?: ExecutionResult;
8 operation: Operation;
9}
10export declare const defaultGenerateHash: (query: DocumentNode) => string;
11export declare const defaultOptions: {
12 generateHash: (query: DocumentNode) => string;
13 disable: ({graphQLErrors, operation}: ErrorResponse) => boolean;
14 useGETForHashedQueries: boolean;
15};
16export declare const createPersistedQueryLink: (options?: {
17 generateHash?: ((document: DocumentNode) => string) | undefined;
18 disable?: ((error: ErrorResponse) => boolean) | undefined;
19 useGETForHashedQueries?: boolean | undefined;
20}) => ApolloLink;