UNPKG

1.04 kBTypeScriptView Raw
1import { GraphQLRequest, NextLink, Operation, RequestHandler, FetchResult } from './types';
2import Observable from 'zen-observable-ts';
3export declare abstract class ApolloLink {
4 static from(links: (ApolloLink | RequestHandler)[]): ApolloLink;
5 static empty(): ApolloLink;
6 static passthrough(): ApolloLink;
7 static split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink;
8 split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink;
9 concat(next: ApolloLink | RequestHandler): ApolloLink;
10 abstract request(operation: Operation, forward?: NextLink): Observable<FetchResult> | null;
11}
12export declare function execute(link: ApolloLink, operation: GraphQLRequest): Observable<FetchResult>;
13export declare class FunctionLink extends ApolloLink {
14 f: RequestHandler;
15 constructor(f: RequestHandler);
16 request(operation: Operation, forward: NextLink): Observable<FetchResult>;
17}