1 | import { IntrospectionOptions } from 'graphql';
|
2 | import { SchemaPointerSingle, Source, DocumentLoader, SingleFileOptions } from '@graphql-tools/utils';
|
3 | import { fetch as crossFetch } from 'cross-fetch';
|
4 | import { AsyncExecutor, Subscriber } from '@graphql-tools/delegate';
|
5 | import { w3cwebsocket } from 'websocket';
|
6 | export declare type FetchFn = typeof import('cross-fetch').fetch;
|
7 | declare type Headers = Record<string, string> | Array<Record<string, string>>;
|
8 |
|
9 |
|
10 |
|
11 | export interface LoadFromUrlOptions extends SingleFileOptions, Partial<IntrospectionOptions> {
|
12 | |
13 |
|
14 |
|
15 | headers?: Headers;
|
16 | |
17 |
|
18 |
|
19 |
|
20 | customFetch?: FetchFn | string;
|
21 | |
22 |
|
23 |
|
24 | method?: 'GET' | 'POST';
|
25 | |
26 |
|
27 |
|
28 | enableSubscriptions?: boolean;
|
29 | |
30 |
|
31 |
|
32 |
|
33 | webSocketImpl?: typeof w3cwebsocket | string;
|
34 | |
35 |
|
36 |
|
37 | useGETForQueries?: boolean;
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | export declare class UrlLoader implements DocumentLoader<LoadFromUrlOptions> {
|
52 | loaderId(): string;
|
53 | canLoad(pointer: SchemaPointerSingle, options: LoadFromUrlOptions): Promise<boolean>;
|
54 | canLoadSync(pointer: SchemaPointerSingle, _options: LoadFromUrlOptions): boolean;
|
55 | buildAsyncExecutor({ pointer, fetch, extraHeaders, defaultMethod, useGETForQueries, }: {
|
56 | pointer: string;
|
57 | fetch: typeof crossFetch;
|
58 | extraHeaders: any;
|
59 | defaultMethod: 'GET' | 'POST';
|
60 | useGETForQueries: boolean;
|
61 | }): AsyncExecutor;
|
62 | buildSubscriber(pointer: string, webSocketImpl: typeof w3cwebsocket): Subscriber;
|
63 | getExecutorAndSubscriber(pointer: SchemaPointerSingle, options: LoadFromUrlOptions): Promise<{
|
64 | executor: AsyncExecutor;
|
65 | subscriber: Subscriber;
|
66 | }>;
|
67 | getSubschemaConfig(pointer: SchemaPointerSingle, options: LoadFromUrlOptions): Promise<{
|
68 | schema: import("graphql").GraphQLSchema;
|
69 | executor: AsyncExecutor;
|
70 | subscriber: Subscriber;
|
71 | }>;
|
72 | load(pointer: SchemaPointerSingle, options: LoadFromUrlOptions): Promise<Source>;
|
73 | loadSync(): never;
|
74 | }
|
75 | export {};
|