Skip to content

Commit 8ddef33

Browse files
committed
extendSchema: inline ASTDefinitionBuilder class methods
1 parent 96a4e74 commit 8ddef33

File tree

3 files changed

+117
-125
lines changed

3 files changed

+117
-125
lines changed

src/type/schema.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,14 @@ export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {
112112
astNode?: Maybe<SchemaDefinitionNode>;
113113
extensionASTNodes?: Maybe<ReadonlyArray<SchemaExtensionNode>>;
114114
}
115+
116+
/**
117+
* @internal
118+
*/
119+
export interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig {
120+
types: Array<GraphQLNamedType>;
121+
directives: Array<GraphQLDirective>;
122+
extensions: Maybe<Readonly<Record<string, any>>>;
123+
extensionASTNodes: Maybe<ReadonlyArray<SchemaExtensionNode>>;
124+
assumeValid: boolean;
125+
}

src/utilities/extendSchema.d.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import Maybe from '../tsutils/Maybe';
22
import { Location, DocumentNode, StringValueNode } from '../language/ast';
3-
import { GraphQLSchemaValidationOptions, GraphQLSchema } from '../type/schema';
3+
import {
4+
GraphQLSchemaValidationOptions,
5+
GraphQLSchema,
6+
GraphQLSchemaNormalizedConfig,
7+
} from '../type/schema';
48

59
interface Options extends GraphQLSchemaValidationOptions {
610
/**
@@ -45,6 +49,15 @@ export function extendSchema(
4549
options?: Options,
4650
): GraphQLSchema;
4751

52+
/**
53+
* @internal
54+
*/
55+
export function extendSchemaImpl(
56+
schemaConfig: GraphQLSchemaNormalizedConfig,
57+
documentAST: DocumentNode,
58+
options?: Options,
59+
): GraphQLSchemaNormalizedConfig;
60+
4861
/**
4962
* Given an ast node, returns its string description.
5063
* @deprecated: provided to ease adoption and will be removed in v16.

0 commit comments

Comments
 (0)