UNPKG

950 BTypeScriptView Raw
1import { DocumentNode } from 'graphql/language/ast';
2export declare type Variables = {
3 [key: string]: any;
4};
5export interface GraphQLError {
6 message: string;
7 locations?: {
8 line: number;
9 column: number;
10 }[];
11 path?: string[];
12 extensions?: any;
13}
14export interface GraphQLResponse<T = any> {
15 data?: T;
16 errors?: GraphQLError[];
17 extensions?: any;
18 status: number;
19 [key: string]: any;
20}
21export interface GraphQLRequestContext<V = Variables> {
22 query: string | string[];
23 variables?: V;
24}
25export declare class ClientError extends Error {
26 response: GraphQLResponse;
27 request: GraphQLRequestContext;
28 constructor(response: GraphQLResponse, request: GraphQLRequestContext);
29 private static extractMessage;
30}
31export declare type RequestDocument = string | DocumentNode;
32export declare type BatchRequestDocument<V = Variables> = {
33 document: RequestDocument;
34 variables?: V;
35};