UNPKG

984 BTypeScriptView Raw
1export declare type Variables = {
2 [key: string]: any;
3};
4export interface Options {
5 method?: RequestInit['method'];
6 headers?: {
7 [key: string]: string;
8 };
9 mode?: RequestInit['mode'];
10 credentials?: RequestInit['credentials'];
11 cache?: RequestInit['cache'];
12 redirect?: RequestInit['redirect'];
13 referrer?: RequestInit['referrer'];
14 referrerPolicy?: RequestInit['referrerPolicy'];
15 integrity?: RequestInit['integrity'];
16 keepalive?: boolean;
17}
18export declare type HttpOptions = Options & {
19 uri: string;
20};
21export interface GraphQLError {
22 message: string;
23 locations?: {
24 line: number;
25 column: number;
26 }[];
27 path?: string[];
28}
29export interface GraphQLResponse {
30 data?: any;
31 errors?: GraphQLError[];
32 status: number;
33 [key: string]: any;
34}
35export interface GraphQLRequestContext {
36 query: string;
37 variables?: Variables;
38}
39export interface ClientOptions {
40 cacheResults?: boolean;
41}