1 | import { Loader, BaseLoaderOptions, Source } from '@graphql-tools/utils';
|
2 | import { GraphQLTagPluckOptions } from '@graphql-tools/graphql-tag-pluck';
|
3 | import syncFetch from '@ardatan/sync-fetch';
|
4 | import { fetch as asyncFetch } from '@whatwg-node/fetch';
|
5 |
|
6 |
|
7 |
|
8 | export interface GithubLoaderOptions extends BaseLoaderOptions {
|
9 | |
10 |
|
11 |
|
12 | token: string;
|
13 | |
14 |
|
15 |
|
16 | pluckConfig?: GraphQLTagPluckOptions;
|
17 | customFetch?: typeof asyncFetch | typeof syncFetch;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export declare class GithubLoader implements Loader<GithubLoaderOptions> {
|
30 | canLoad(pointer: string): Promise<boolean>;
|
31 | canLoadSync(pointer: string): boolean;
|
32 | load(pointer: string, options: GithubLoaderOptions): Promise<Source[]>;
|
33 | loadSync(pointer: string, options: GithubLoaderOptions): Source[];
|
34 | handleResponse({ pointer, path, options, response, status, }: {
|
35 | pointer: string;
|
36 | path: string;
|
37 | options: any;
|
38 | response: any;
|
39 | status: number;
|
40 | }): Source[] | {
|
41 | location: string | undefined;
|
42 | document: import("graphql").DocumentNode;
|
43 | }[];
|
44 | prepareRequest({ owner, ref, path, name, options, }: {
|
45 | owner: string;
|
46 | ref: string;
|
47 | path: string;
|
48 | name: string;
|
49 | options: GithubLoaderOptions;
|
50 | }): RequestInit;
|
51 | }
|