UNPKG

723 BTypeScriptView Raw
1import { DataSourceConfig } from "apollo-datasource";
2import { GraphQLRequest } from "apollo-link";
3import { GraphQLError } from "graphql";
4export interface GraphQLResponse<T> {
5 data?: T;
6 errors?: GraphQLError[];
7}
8export declare class GraphQLDataSource<TContext = any> {
9 baseURL: string;
10 context: TContext;
11 initialize(config: DataSourceConfig<TContext>): void;
12 execute<T>(operation: GraphQLRequest): Promise<GraphQLResponse<T>>;
13 protected willSendRequest?(request: any): any;
14 private composeLinks;
15 private didEncounterError;
16 private executeSingleOperation;
17 private resolveUri;
18 private onRequestLink;
19 private onErrorLink;
20}
21//# sourceMappingURL=GraphQLDataSource.d.ts.map
\No newline at end of file