1 | import { Source, Loader } from '@graphql-tools/utils';
|
2 | import { UnnormalizedTypeDefPointer, LoadTypedefsOptions as ToolsLoadTypedefsOptions, LoadSchemaOptions as ToolsLoadSchemaOptions } from '@graphql-tools/load';
|
3 | import { GraphQLSchema, DocumentNode } from 'graphql';
|
4 | import { MiddlewareFn } from './helpers/index.js';
|
5 | type Pointer = UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[];
|
6 | type LoadTypedefsOptions = Partial<ToolsLoadTypedefsOptions>;
|
7 | type LoadSchemaOptions = Partial<ToolsLoadSchemaOptions>;
|
8 | export type SchemaOutput = 'GraphQLSchema' | 'DocumentNode' | 'string';
|
9 | export declare class LoadersRegistry {
|
10 | private _loaders;
|
11 | private _middlewares;
|
12 | private readonly cwd;
|
13 | constructor({ cwd }: {
|
14 | cwd: string;
|
15 | });
|
16 | register(loader: Loader): void;
|
17 | override(loaders: Loader[]): void;
|
18 | use(middleware: MiddlewareFn<DocumentNode>): void;
|
19 | loadTypeDefs(pointer: Pointer, options?: LoadTypedefsOptions): Promise<Source[]>;
|
20 | loadTypeDefsSync(pointer: Pointer, options?: LoadTypedefsOptions): Source[];
|
21 | loadDocuments(pointer: Pointer, options?: LoadTypedefsOptions): Promise<Source[]>;
|
22 | loadDocumentsSync(pointer: Pointer, options?: LoadTypedefsOptions): Source[];
|
23 | loadSchema(pointer: Pointer): Promise<GraphQLSchema>;
|
24 | loadSchema(pointer: Pointer, out: 'string', options?: LoadSchemaOptions): Promise<GraphQLSchema>;
|
25 | loadSchema(pointer: Pointer, out: 'DocumentNode', options?: LoadSchemaOptions): Promise<DocumentNode>;
|
26 | loadSchema(pointer: Pointer, out: 'GraphQLSchema', options?: LoadSchemaOptions): Promise<GraphQLSchema>;
|
27 | loadSchemaSync(pointer: Pointer): GraphQLSchema;
|
28 | loadSchemaSync(pointer: Pointer, out: 'string', options?: LoadSchemaOptions): GraphQLSchema;
|
29 | loadSchemaSync(pointer: Pointer, out: 'DocumentNode', options?: LoadSchemaOptions): DocumentNode;
|
30 | loadSchemaSync(pointer: Pointer, out: 'GraphQLSchema', options?: LoadSchemaOptions): GraphQLSchema;
|
31 | private createOptions;
|
32 | private transformSchemaSources;
|
33 | private castSchema;
|
34 | }
|
35 | export {};
|
36 |
|
\ | No newline at end of file |