UNPKG

1.19 kBTypeScriptView Raw
1import { DocumentNode, ExecutionResult, GraphQLError } from 'graphql';
2import { ApolloLink, Operation } from '../core';
3import { NetworkError } from '../../errors';
4export declare const VERSION = 1;
5export interface ErrorResponse {
6 graphQLErrors?: readonly GraphQLError[];
7 networkError?: NetworkError;
8 response?: ExecutionResult;
9 operation: Operation;
10}
11declare type SHA256Function = (...args: any[]) => string | PromiseLike<string>;
12declare type GenerateHashFunction = (document: DocumentNode) => string | PromiseLike<string>;
13export declare namespace PersistedQueryLink {
14 interface BaseOptions {
15 disable?: (error: ErrorResponse) => boolean;
16 useGETForHashedQueries?: boolean;
17 }
18 interface SHA256Options extends BaseOptions {
19 sha256: SHA256Function;
20 generateHash?: never;
21 }
22 interface GenerateHashOptions extends BaseOptions {
23 sha256?: never;
24 generateHash: GenerateHashFunction;
25 }
26 export type Options = SHA256Options | GenerateHashOptions;
27 export {};
28}
29export declare const createPersistedQueryLink: (options: PersistedQueryLink.Options) => ApolloLink;
30export {};
31//# sourceMappingURL=index.d.ts.map
\No newline at end of file