UNPKG

741 BTypeScriptView Raw
1import Observable from 'zen-observable-ts';
2import { ExecutionResult, DocumentNode } from 'graphql';
3export interface GraphQLRequest {
4 query?: string | DocumentNode;
5 variables?: Record<string, any>;
6 context?: Record<string, any>;
7}
8export interface Operation {
9 query: DocumentNode;
10 variables?: Record<string, any>;
11 operationName?: string;
12 context?: Record<string, any>;
13}
14export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
15 extensions?: E;
16 context?: C;
17};
18export declare type NextLink = (operation: Operation) => Observable<FetchResult>;
19export declare type RequestHandler = (operation: Operation, forward?: NextLink) => Observable<FetchResult> | null;