1 | import type { Maybe } from '../jsutils/Maybe';
|
2 | import type { ObjMap } from '../jsutils/ObjMap';
|
3 | import type { GraphQLError } from '../error/GraphQLError';
|
4 | import type {
|
5 | SchemaDefinitionNode,
|
6 | SchemaExtensionNode,
|
7 | } from '../language/ast';
|
8 | import { OperationTypeNode } from '../language/ast';
|
9 | import type {
|
10 | GraphQLAbstractType,
|
11 | GraphQLInterfaceType,
|
12 | GraphQLNamedType,
|
13 | GraphQLObjectType,
|
14 | } from './definition';
|
15 | import type { GraphQLDirective } from './directives';
|
16 |
|
17 |
|
18 |
|
19 | export declare function isSchema(schema: unknown): schema is GraphQLSchema;
|
20 | export declare function assertSchema(schema: unknown): GraphQLSchema;
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export interface GraphQLSchemaExtensions {
|
31 | [attributeName: string]: unknown;
|
32 | }
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | export declare class GraphQLSchema {
|
102 | description: Maybe<string>;
|
103 | extensions: Readonly<GraphQLSchemaExtensions>;
|
104 | astNode: Maybe<SchemaDefinitionNode>;
|
105 | extensionASTNodes: ReadonlyArray<SchemaExtensionNode>;
|
106 | __validationErrors: Maybe<ReadonlyArray<GraphQLError>>;
|
107 | private _queryType;
|
108 | private _mutationType;
|
109 | private _subscriptionType;
|
110 | private _directives;
|
111 | private _typeMap;
|
112 | private _subTypeMap;
|
113 | private _implementationsMap;
|
114 | constructor(config: Readonly<GraphQLSchemaConfig>);
|
115 | get [Symbol.toStringTag](): string;
|
116 | getQueryType(): Maybe<GraphQLObjectType>;
|
117 | getMutationType(): Maybe<GraphQLObjectType>;
|
118 | getSubscriptionType(): Maybe<GraphQLObjectType>;
|
119 | getRootType(operation: OperationTypeNode): Maybe<GraphQLObjectType>;
|
120 | getTypeMap(): TypeMap;
|
121 | getType(name: string): GraphQLNamedType | undefined;
|
122 | getPossibleTypes(
|
123 | abstractType: GraphQLAbstractType,
|
124 | ): ReadonlyArray<GraphQLObjectType>;
|
125 | getImplementations(interfaceType: GraphQLInterfaceType): {
|
126 | objects: ReadonlyArray<GraphQLObjectType>;
|
127 | interfaces: ReadonlyArray<GraphQLInterfaceType>;
|
128 | };
|
129 | isSubType(
|
130 | abstractType: GraphQLAbstractType,
|
131 | maybeSubType: GraphQLObjectType | GraphQLInterfaceType,
|
132 | ): boolean;
|
133 | getDirectives(): ReadonlyArray<GraphQLDirective>;
|
134 | getDirective(name: string): Maybe<GraphQLDirective>;
|
135 | toConfig(): GraphQLSchemaNormalizedConfig;
|
136 | }
|
137 | declare type TypeMap = ObjMap<GraphQLNamedType>;
|
138 | export interface GraphQLSchemaValidationOptions {
|
139 | |
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | assumeValid?: boolean;
|
147 | }
|
148 | export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {
|
149 | description?: Maybe<string>;
|
150 | query?: Maybe<GraphQLObjectType>;
|
151 | mutation?: Maybe<GraphQLObjectType>;
|
152 | subscription?: Maybe<GraphQLObjectType>;
|
153 | types?: Maybe<ReadonlyArray<GraphQLNamedType>>;
|
154 | directives?: Maybe<ReadonlyArray<GraphQLDirective>>;
|
155 | extensions?: Maybe<Readonly<GraphQLSchemaExtensions>>;
|
156 | astNode?: Maybe<SchemaDefinitionNode>;
|
157 | extensionASTNodes?: Maybe<ReadonlyArray<SchemaExtensionNode>>;
|
158 | }
|
159 |
|
160 |
|
161 |
|
162 | export interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig {
|
163 | description: Maybe<string>;
|
164 | types: ReadonlyArray<GraphQLNamedType>;
|
165 | directives: ReadonlyArray<GraphQLDirective>;
|
166 | extensions: Readonly<GraphQLSchemaExtensions>;
|
167 | extensionASTNodes: ReadonlyArray<SchemaExtensionNode>;
|
168 | assumeValid: boolean;
|
169 | }
|
170 | export {};
|