UNPKG

1.63 kBTypeScriptView Raw
1import type { Observer } from "../../utilities/index.js";
2import { Observable } from "../../utilities/index.js";
3import type { NextLink, Operation, RequestHandler, FetchResult, GraphQLRequest } from "./types.js";
4export declare class ApolloLink {
5 static empty(): ApolloLink;
6 static from(links: (ApolloLink | RequestHandler)[]): ApolloLink;
7 static split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink;
8 static execute(link: ApolloLink, operation: GraphQLRequest): Observable<FetchResult>;
9 static concat(first: ApolloLink | RequestHandler, second: ApolloLink | RequestHandler): ApolloLink;
10 constructor(request?: RequestHandler);
11 split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink;
12 concat(next: ApolloLink | RequestHandler): ApolloLink;
13 request(operation: Operation, forward?: NextLink): Observable<FetchResult> | null;
14 protected onError(error: any, observer?: Observer<FetchResult>): false | void;
15 setOnError(fn: ApolloLink["onError"]): this;
16 /**
17 * @internal
18 * Used to iterate through all links that are concatenations or `split` links.
19 */
20 readonly left?: ApolloLink;
21 /**
22 * @internal
23 * Used to iterate through all links that are concatenations or `split` links.
24 */
25 readonly right?: ApolloLink;
26 /**
27 * @internal
28 * Can be provided by a link that has an internal cache to report it's memory details.
29 */
30 getMemoryInternals?: () => unknown;
31}
32//# sourceMappingURL=ApolloLink.d.ts.map
\No newline at end of file