UNPKG

2.89 kBTypeScriptView Raw
1import { GraphQLSchema, DocumentNode } from 'graphql';
2import { Source } from '@graphql-tools/utils';
3import { GraphQLExtensionsRegistry } from './extension';
4import { IExtensions, IGraphQLProject, IGraphQLProjectLegacy } from './types';
5import { LoadSchemaOptions as ToolsLoadSchemaOptions, LoadTypedefsOptions as ToolsLoadTypedefsOptions, UnnormalizedTypeDefPointer } from '@graphql-tools/load';
6declare type Pointer = UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[];
7declare type LoadTypedefsOptions = Partial<ToolsLoadTypedefsOptions>;
8declare type LoadSchemaOptions = Partial<ToolsLoadSchemaOptions>;
9export declare class GraphQLProjectConfig {
10 readonly schema: Pointer;
11 readonly documents?: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[];
12 readonly include?: string | string[];
13 readonly exclude?: string | string[];
14 readonly extensions: IExtensions;
15 readonly filepath: string;
16 readonly dirpath: string;
17 readonly name: string;
18 readonly isLegacy: boolean;
19 private readonly _extensionsRegistry;
20 constructor({ filepath, name, config, extensionsRegistry, }: {
21 filepath: string;
22 name: string;
23 config: IGraphQLProject | IGraphQLProjectLegacy;
24 extensionsRegistry: GraphQLExtensionsRegistry;
25 });
26 hasExtension(name: string): boolean;
27 extension<T = any>(name: string): T;
28 getSchema(): Promise<GraphQLSchema>;
29 getSchema(out: 'DocumentNode'): Promise<DocumentNode>;
30 getSchema(out: 'GraphQLSchema'): Promise<GraphQLSchema>;
31 getSchema(out: 'string'): Promise<string>;
32 getSchemaSync(): GraphQLSchema;
33 getSchemaSync(out: 'DocumentNode'): DocumentNode;
34 getSchemaSync(out: 'GraphQLSchema'): GraphQLSchema;
35 getSchemaSync(out: 'string'): string;
36 getDocuments(): Promise<Source[]>;
37 getDocumentsSync(): Source[];
38 loadSchema(pointer: Pointer): Promise<GraphQLSchema>;
39 loadSchema(pointer: Pointer, out: 'string', options?: LoadSchemaOptions): Promise<GraphQLSchema>;
40 loadSchema(pointer: Pointer, out: 'DocumentNode', options?: LoadSchemaOptions): Promise<DocumentNode>;
41 loadSchema(pointer: Pointer, out: 'GraphQLSchema', options?: LoadSchemaOptions): Promise<GraphQLSchema>;
42 loadSchemaSync(pointer: Pointer): GraphQLSchema;
43 loadSchemaSync(pointer: Pointer, out: 'string', options?: LoadSchemaOptions): GraphQLSchema;
44 loadSchemaSync(pointer: Pointer, out: 'DocumentNode', options?: LoadSchemaOptions): DocumentNode;
45 loadSchemaSync(pointer: Pointer, out: 'GraphQLSchema', options?: LoadSchemaOptions): GraphQLSchema;
46 loadDocuments(pointer: Pointer, options?: LoadTypedefsOptions): Promise<Source[]>;
47 loadDocumentsSync(pointer: Pointer, options?: LoadTypedefsOptions): Source[];
48 match(filepath: string): boolean;
49}
50export {};
51//# sourceMappingURL=project-config.d.ts.map
\No newline at end of file