Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce927c4

Browse files
committedJan 16, 2018
Reuse transformSchema inside extendSchema
1 parent 85f68f9 commit ce927c4

File tree

4 files changed

+160
-286
lines changed

4 files changed

+160
-286
lines changed
 

‎src/utilities/buildASTSchema.js

+16-26
Original file line numberDiff line numberDiff line change
@@ -177,23 +177,20 @@ export function buildASTSchema(
177177
const operationTypes = schemaDef
178178
? getOperationTypes(schemaDef)
179179
: {
180-
query: nodeMap.Query ? 'Query' : null,
181-
mutation: nodeMap.Mutation ? 'Mutation' : null,
182-
subscription: nodeMap.Subscription ? 'Subscription' : null,
180+
query: nodeMap.Query,
181+
mutation: nodeMap.Mutation,
182+
subscription: nodeMap.Subscription,
183183
};
184184

185185
const definitionBuilder = new ASTDefinitionBuilder(
186186
nodeMap,
187187
options,
188-
typeName => {
189-
throw new Error(`Type "${typeName}" not found in document.`);
188+
typeRef => {
189+
throw new Error(`Type "${typeRef.name.value}" not found in document.`);
190190
},
191191
);
192192

193-
const types = typeDefs.map(def =>
194-
definitionBuilder.buildType(def.name.value),
195-
);
196-
193+
const types = typeDefs.map(def => definitionBuilder.buildType(def));
197194
const directives = directiveDefs.map(def =>
198195
definitionBuilder.buildDirective(def),
199196
);
@@ -243,17 +240,14 @@ export function buildASTSchema(
243240
`Specified ${operation} type "${typeName}" not found in document.`,
244241
);
245242
}
246-
opTypes[operation] = typeName;
243+
opTypes[operation] = operationType.type;
247244
});
248245
return opTypes;
249246
}
250247
}
251248

252249
type TypeDefinitionsMap = ObjMap<TypeDefinitionNode>;
253-
type TypeResolver = (
254-
typeName: string,
255-
node?: ?NamedTypeNode,
256-
) => GraphQLNamedType;
250+
type TypeResolver = (typeRef: NamedTypeNode) => GraphQLNamedType;
257251

258252
export class ASTDefinitionBuilder {
259253
_typeDefinitionsMap: TypeDefinitionsMap;
@@ -276,25 +270,21 @@ export class ASTDefinitionBuilder {
276270
);
277271
}
278272

279-
_buildType(typeName: string, typeNode?: ?NamedTypeNode): GraphQLNamedType {
273+
buildType(node: NamedTypeNode | TypeDefinitionNode): GraphQLNamedType {
274+
const typeName = node.name.value;
280275
if (!this._cache[typeName]) {
281-
const defNode = this._typeDefinitionsMap[typeName];
282-
if (defNode) {
283-
this._cache[typeName] = this._makeSchemaDef(defNode);
276+
if (node.kind === Kind.NAMED_TYPE) {
277+
const defNode = this._typeDefinitionsMap[typeName];
278+
this._cache[typeName] = defNode
279+
? this._makeSchemaDef(defNode)
280+
: this._resolveType(node);
284281
} else {
285-
this._cache[typeName] = this._resolveType(typeName, typeNode);
282+
this._cache[typeName] = this._makeSchemaDef(node);
286283
}
287284
}
288285
return this._cache[typeName];
289286
}
290287

291-
buildType(ref: string | NamedTypeNode): GraphQLNamedType {
292-
if (typeof ref === 'string') {
293-
return this._buildType(ref);
294-
}
295-
return this._buildType(ref.name.value, ref);
296-
}
297-
298288
_buildWrappedType(typeNode: TypeNode): GraphQLType {
299289
const typeDef = this.buildType(getNamedTypeNode(typeNode));
300290
return buildWrappedType(typeDef, typeNode);

‎src/utilities/extendSchema.js

+60-194
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,12 @@
88
*/
99

1010
import invariant from '../jsutils/invariant';
11-
import keyMap from '../jsutils/keyMap';
1211
import { ASTDefinitionBuilder } from './buildASTSchema';
12+
import { SchemaTransformer } from './transformSchema';
1313
import { GraphQLError } from '../error/GraphQLError';
1414
import { isSchema, GraphQLSchema } from '../type/schema';
15-
16-
import {
17-
isObjectType,
18-
isInterfaceType,
19-
isUnionType,
20-
isListType,
21-
isNonNullType,
22-
GraphQLObjectType,
23-
GraphQLInterfaceType,
24-
GraphQLUnionType,
25-
} from '../type/definition';
26-
import { GraphQLList, GraphQLNonNull } from '../type/wrappers';
27-
28-
import { GraphQLDirective } from '../type/directives';
29-
15+
import { isObjectType, GraphQLObjectType } from '../type/definition';
3016
import * as Kind from '../language/kinds';
31-
32-
import type { GraphQLType, GraphQLNamedType } from '../type/definition';
33-
3417
import type { DocumentNode, DirectiveDefinitionNode } from '../language/ast';
3518

3619
type Options = {|
@@ -171,204 +154,87 @@ export function extendSchema(
171154
return schema;
172155
}
173156

174-
const definitionBuilder = new ASTDefinitionBuilder(
157+
const astBuilder = new ASTDefinitionBuilder(
175158
typeDefinitionMap,
176159
options,
177-
(typeName, node) => {
178-
const existingType = schema.getType(typeName);
179-
if (existingType) {
180-
return extendType(existingType);
181-
}
160+
typeRef => {
161+
invariant(schemaTransformer);
162+
const typeName = typeRef.name.value;
163+
const type = schemaTransformer.transformType(typeName);
182164

183-
if (node) {
165+
if (!type) {
184166
throw new GraphQLError(
185167
`Unknown type: "${typeName}". Ensure that this type exists ` +
186168
'either in the original schema, or is added in a type definition.',
187-
[node],
169+
[typeRef],
188170
);
189171
}
190-
throw GraphQLError('Missing type from schema');
172+
return type;
191173
},
192174
);
193175

194-
// Get the root Query, Mutation, and Subscription object types.
195-
// Note: While this could make early assertions to get the correctly
196-
// typed values below, that would throw immediately while type system
197-
// validation with validateSchema() will produce more actionable results.
198-
const existingQueryType = schema.getQueryType();
199-
const queryType = existingQueryType
200-
? (definitionBuilder.buildType(existingQueryType.name): any)
201-
: null;
176+
const schemaTransformer = new SchemaTransformer(schema, {
177+
Schema(config) {
178+
const newDirectives = directiveDefinitions.map(node =>
179+
astBuilder.buildDirective(node),
180+
);
202181

203-
const existingMutationType = schema.getMutationType();
204-
const mutationType = existingMutationType
205-
? (definitionBuilder.buildType(existingMutationType.name): any)
206-
: null;
207-
208-
const existingSubscriptionType = schema.getSubscriptionType();
209-
const subscriptionType = existingSubscriptionType
210-
? (definitionBuilder.buildType(existingSubscriptionType.name): any)
211-
: null;
212-
213-
// Iterate through all types, getting the type definition for each, ensuring
214-
// that any type not directly referenced by a field will get created.
215-
const typeMap = schema.getTypeMap();
216-
const types = Object.keys(typeMap).map(typeName =>
217-
definitionBuilder.buildType(typeName),
218-
);
219-
220-
// Do the same with new types, appending to the list of defined types.
221-
Object.keys(typeDefinitionMap).forEach(typeName => {
222-
types.push(definitionBuilder.buildType(typeName));
223-
});
182+
const newTypes = [];
183+
Object.keys(typeDefinitionMap).forEach(typeName => {
184+
const def = typeDefinitionMap[typeName];
185+
newTypes.push(astBuilder.buildType(def));
186+
});
224187

225-
// Then produce and return a Schema with these types.
226-
return new GraphQLSchema({
227-
query: queryType,
228-
mutation: mutationType,
229-
subscription: subscriptionType,
230-
types,
231-
directives: getMergedDirectives(),
232-
astNode: schema.astNode,
188+
return new GraphQLSchema({
189+
...config,
190+
types: config.types.concat(newTypes),
191+
directives: config.directives.concat(newDirectives),
192+
});
193+
},
194+
ObjectType(config) {
195+
const extensions = typeExtensionsMap[config.name] || [];
196+
return new GraphQLObjectType({
197+
...config,
198+
interfaces: () => extendImplementedInterfaces(config, extensions),
199+
fields: () => extendFieldMap(config, extensions),
200+
extensionASTNodes: config.extensionASTNodes.concat(extensions),
201+
});
202+
},
233203
});
234204

235-
// Below are functions used for producing this schema that have closed over
236-
// this scope and have access to the schema, cache, and newly defined types.
237-
238-
function getMergedDirectives(): Array<GraphQLDirective> {
239-
const existingDirectives = schema.getDirectives();
240-
invariant(existingDirectives, 'schema must have default directives');
241-
242-
const newDirectives = directiveDefinitions.map(directiveNode =>
243-
definitionBuilder.buildDirective(directiveNode),
244-
);
245-
return existingDirectives.concat(newDirectives);
246-
}
247-
248-
function getTypeFromDef<T: GraphQLNamedType>(typeDef: T): T {
249-
const type = definitionBuilder.buildType(typeDef.name);
250-
return (type: any);
251-
}
205+
return schemaTransformer.transformSchema();
252206

253-
// Given a type's introspection result, construct the correct
254-
// GraphQLType instance.
255-
function extendType(type: GraphQLNamedType): GraphQLNamedType {
256-
if (isObjectType(type)) {
257-
return extendObjectType(type);
258-
}
259-
if (isInterfaceType(type)) {
260-
return extendInterfaceType(type);
261-
}
262-
if (isUnionType(type)) {
263-
return extendUnionType(type);
264-
}
265-
return type;
266-
}
267-
268-
function extendObjectType(type: GraphQLObjectType): GraphQLObjectType {
269-
const name = type.name;
270-
const extensionASTNodes = typeExtensionsMap[name]
271-
? type.extensionASTNodes
272-
? type.extensionASTNodes.concat(typeExtensionsMap[name])
273-
: typeExtensionsMap[name]
274-
: type.extensionASTNodes;
275-
return new GraphQLObjectType({
276-
name,
277-
description: type.description,
278-
interfaces: () => extendImplementedInterfaces(type),
279-
fields: () => extendFieldMap(type),
280-
astNode: type.astNode,
281-
extensionASTNodes,
282-
isTypeOf: type.isTypeOf,
283-
});
284-
}
285-
286-
function extendInterfaceType(
287-
type: GraphQLInterfaceType,
288-
): GraphQLInterfaceType {
289-
return new GraphQLInterfaceType({
290-
name: type.name,
291-
description: type.description,
292-
fields: () => extendFieldMap(type),
293-
astNode: type.astNode,
294-
resolveType: type.resolveType,
295-
});
296-
}
297-
298-
function extendUnionType(type: GraphQLUnionType): GraphQLUnionType {
299-
return new GraphQLUnionType({
300-
name: type.name,
301-
description: type.description,
302-
types: type.getTypes().map(getTypeFromDef),
303-
astNode: type.astNode,
304-
resolveType: type.resolveType,
305-
});
306-
}
307-
308-
function extendImplementedInterfaces(
309-
type: GraphQLObjectType,
310-
): Array<GraphQLInterfaceType> {
311-
const interfaces = type.getInterfaces().map(getTypeFromDef);
312-
313-
// If there are any extensions to the interfaces, apply those here.
314-
const extensions = typeExtensionsMap[type.name];
315-
if (extensions) {
316-
extensions.forEach(extension => {
317-
extension.interfaces.forEach(namedType => {
207+
function extendImplementedInterfaces(config, extensions) {
208+
return config.interfaces().concat(
209+
...extensions.map(extension =>
210+
extension.interfaces.map(
318211
// Note: While this could make early assertions to get the correctly
319212
// typed values, that would throw immediately while type system
320213
// validation with validateSchema() will produce more actionable results.
321-
interfaces.push((definitionBuilder.buildType(namedType): any));
322-
});
323-
});
324-
}
325-
326-
return interfaces;
214+
type => (astBuilder.buildType(type): any),
215+
),
216+
),
217+
);
327218
}
328219

329-
function extendFieldMap(type: GraphQLObjectType | GraphQLInterfaceType) {
330-
const newFieldMap = Object.create(null);
331-
const oldFieldMap = type.getFields();
332-
Object.keys(oldFieldMap).forEach(fieldName => {
333-
const field = oldFieldMap[fieldName];
334-
newFieldMap[fieldName] = {
335-
description: field.description,
336-
deprecationReason: field.deprecationReason,
337-
type: extendFieldType(field.type),
338-
args: keyMap(field.args, arg => arg.name),
339-
astNode: field.astNode,
340-
resolve: field.resolve,
341-
};
342-
});
343-
344-
// If there are any extensions to the fields, apply those here.
345-
const extensions = typeExtensionsMap[type.name];
346-
if (extensions) {
347-
extensions.forEach(extension => {
348-
extension.fields.forEach(field => {
349-
const fieldName = field.name.value;
350-
if (oldFieldMap[fieldName]) {
351-
throw new GraphQLError(
352-
`Field "${type.name}.${fieldName}" already exists in the ` +
353-
'schema. It cannot also be defined in this type extension.',
354-
[field],
355-
);
356-
}
357-
newFieldMap[fieldName] = definitionBuilder.buildField(field);
358-
});
359-
});
360-
}
220+
function extendFieldMap(config, extensions) {
221+
const oldFields = config.fields();
222+
const fieldMap = { ...oldFields };
361223

362-
return newFieldMap;
363-
}
224+
for (const extension of extensions) {
225+
for (const field of extension.fields) {
226+
const fieldName = field.name.value;
364227

365-
function extendFieldType<T: GraphQLType>(typeDef: T): T {
366-
if (isListType(typeDef)) {
367-
return (GraphQLList(extendFieldType(typeDef.ofType)): any);
368-
}
369-
if (isNonNullType(typeDef)) {
370-
return (GraphQLNonNull(extendFieldType(typeDef.ofType)): any);
228+
if (oldFields[fieldName]) {
229+
throw new GraphQLError(
230+
`Field "${config.name}.${fieldName}" already exists in the ` +
231+
'schema. It cannot also be defined in this type extension.',
232+
[field],
233+
);
234+
}
235+
fieldMap[fieldName] = astBuilder.buildField(field);
236+
}
371237
}
372-
return getTypeFromDef(typeDef);
238+
return fieldMap;
373239
}
374240
}

‎src/utilities/lexographicSortSchema.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import {
1818
GraphQLEnumType,
1919
GraphQLInputObjectType,
2020
} from '../type/definition';
21-
import { transformSchema } from './transformSchema';
21+
import { SchemaTransformer } from './transformSchema';
2222

2323
/**
2424
* Sort GraphQLSchema.
2525
*/
2626
export function lexographicSortSchema(schema: GraphQLSchema): GraphQLSchema {
27-
return transformSchema(schema, {
27+
const transformer = new SchemaTransformer(schema, {
2828
Schema(config) {
2929
return new GraphQLSchema({
3030
...config,
@@ -74,6 +74,8 @@ export function lexographicSortSchema(schema: GraphQLSchema): GraphQLSchema {
7474
});
7575
},
7676
});
77+
78+
return transformer.transformSchema();
7779
}
7880

7981
function sortFields(fields) {

‎src/utilities/transformSchema.js

+80-64
Original file line numberDiff line numberDiff line change
@@ -88,60 +88,78 @@ type TypeTransformer = {
8888
) => GraphQLInputObjectType,
8989
};
9090

91-
export function transformSchema(
92-
schema: GraphQLSchema,
93-
transformer: TypeTransformer,
94-
): GraphQLSchema {
95-
const cache: ObjMap<GraphQLNamedType> = Object.create(null);
91+
/**
92+
* Note: This class is not a part of public API and is a subject to changes
93+
* in the future.
94+
*/
95+
export class SchemaTransformer {
96+
_schema: GraphQLSchema;
97+
_transformer: TypeTransformer;
98+
_cache: ObjMap<GraphQLNamedType>;
9699

97-
// Workaround for: https://github.com/facebook/flow/issues/2221
98-
const oldTypes: Array<GraphQLNamedType> = (Object.values(
99-
schema.getTypeMap(),
100-
): any);
100+
constructor(schema: GraphQLSchema, transformer: TypeTransformer) {
101+
this._schema = schema;
102+
this._transformer = transformer;
103+
this._cache = Object.create(null);
104+
}
101105

102-
const transformMaybeType = maybeType =>
103-
maybeType && transformNamedType(maybeType);
104-
const schemaConfig = {
105-
types: oldTypes.map(transformNamedType),
106-
directives: schema.getDirectives().map(transformDirective),
107-
query: transformMaybeType(schema.getQueryType()),
108-
mutation: transformMaybeType(schema.getMutationType()),
109-
subscription: transformMaybeType(schema.getSubscriptionType()),
110-
astNode: schema.astNode,
111-
};
112-
return transformer.Schema
113-
? transformer.Schema(schemaConfig)
114-
: new GraphQLSchema(schemaConfig);
106+
transformSchema(): GraphQLSchema {
107+
// Workaround for: https://github.com/facebook/flow/issues/2221
108+
const oldTypes: Array<GraphQLNamedType> = (Object.values(
109+
this._schema.getTypeMap(),
110+
): any);
115111

116-
function transformDirective(directive) {
112+
const transformMaybeType = maybeType =>
113+
maybeType && this._transformNamedType(maybeType);
114+
const schemaConfig = {
115+
types: oldTypes.map(type => this._transformNamedType(type)),
116+
directives: this._schema
117+
.getDirectives()
118+
.map(directive => this._transformDirective(directive)),
119+
query: transformMaybeType(this._schema.getQueryType()),
120+
mutation: transformMaybeType(this._schema.getMutationType()),
121+
subscription: transformMaybeType(this._schema.getSubscriptionType()),
122+
astNode: this._schema.astNode,
123+
};
124+
return this._transformer.Schema
125+
? this._transformer.Schema(schemaConfig)
126+
: new GraphQLSchema(schemaConfig);
127+
}
128+
129+
transformType(name: string): ?GraphQLNamedType {
130+
const type = this._schema.getTypeMap()[name];
131+
return type && this._transformNamedType(type);
132+
}
133+
134+
_transformDirective(directive: GraphQLDirective): GraphQLDirective {
117135
const config = {
118136
name: directive.name,
119137
description: directive.description,
120138
locations: directive.locations,
121-
args: transformArgs(directive.args),
139+
args: this._transformArgs(directive.args),
122140
astNode: directive.astNode,
123141
};
124-
return transformer.Directive
125-
? transformer.Directive(config)
142+
return this._transformer.Directive
143+
? this._transformer.Directive(config)
126144
: new GraphQLDirective(config);
127145
}
128146

129-
function transformArgs(args) {
147+
_transformArgs(args: *): * {
130148
return keyValMap(
131149
args,
132150
arg => arg.name,
133151
arg => ({
134152
...arg,
135-
type: transformType(arg.type),
153+
type: this._transformType(arg.type),
136154
}),
137155
);
138156
}
139157

140-
function transformFields(fieldsMap) {
158+
_transformFields(fieldsMap: *): * {
141159
return () =>
142160
mapValues(fieldsMap, field => ({
143-
type: transformType(field.type),
144-
args: transformArgs(field.args),
161+
type: this._transformType(field.type),
162+
args: this._transformArgs(field.args),
145163
resolve: field.resolve,
146164
subscribe: field.subscribe,
147165
deprecationReason: field.deprecationReason,
@@ -150,47 +168,45 @@ export function transformSchema(
150168
}));
151169
}
152170

153-
function transformInputFields(fieldsMap) {
171+
_transformInputFields(fieldsMap: *): * {
154172
return () =>
155173
mapValues(fieldsMap, field => ({
156-
type: transformType(field.type),
174+
type: this.transformType(field.type),
157175
defaultValue: field.defaultValue,
158176
description: field.description,
159177
astNode: field.astNode,
160178
}));
161179
}
162180

163-
function transformType(type) {
181+
_transformType(type: *): * {
164182
if (isListType(type)) {
165-
return new GraphQLList(transformType(type.ofType));
183+
return new GraphQLList(this._transformType(type.ofType));
166184
} else if (isNonNullType(type)) {
167-
return new GraphQLNonNull(transformType(type.ofType));
185+
return new GraphQLNonNull(this._transformType(type.ofType));
168186
}
169-
return transformNamedType(type);
187+
return this._transformNamedType(type);
170188
}
171189

172-
function transformTypesThunk<T: GraphQLNamedType>(
173-
arr: Array<T>,
174-
): () => Array<T> {
175-
return () => arr.map(transformNamedType);
190+
_transformTypesThunk<T: GraphQLNamedType>(arr: Array<T>): () => Array<T> {
191+
return () => arr.map(type => this._transformNamedType(type));
176192
}
177193

178-
function transformNamedType<T: GraphQLNamedType>(type: T): T {
194+
_transformNamedType<T: GraphQLNamedType>(type: T): T {
179195
if (isSpecifiedScalarType(type) || isIntrospectionType(type)) {
180196
return type;
181197
}
182198

183-
let newType = cache[type.name];
199+
let newType = this._cache[type.name];
184200
if (!newType) {
185-
newType = transformNamedTypeImpl(type);
186-
cache[type.name] = newType;
201+
newType = this._transformNamedTypeImpl(type);
202+
this._cache[type.name] = newType;
187203
}
188204
invariant(type.constructor === newType.constructor);
189205
invariant(type.name === newType.name);
190206
return ((newType: any): T);
191207
}
192208

193-
function transformNamedTypeImpl(type) {
209+
_transformNamedTypeImpl(type: *): * {
194210
if (isScalarType(type)) {
195211
const config = {
196212
name: type.name,
@@ -200,44 +216,44 @@ export function transformSchema(
200216
parseValue: type._scalarConfig.parseValue,
201217
parseLiteral: type._scalarConfig.parseLiteral,
202218
};
203-
return transformer.ScalarType
204-
? transformer.ScalarType(config)
219+
return this._transformer.ScalarType
220+
? this._transformer.ScalarType(config)
205221
: new GraphQLScalarType(config);
206222
} else if (isObjectType(type)) {
207-
const config = {
223+
const config: ExactObjectTypeConfig = {
208224
name: type.name,
209-
interfaces: transformTypesThunk(type.getInterfaces()),
210-
fields: transformFields(type.getFields()),
225+
interfaces: this._transformTypesThunk(type.getInterfaces()),
226+
fields: this._transformFields(type.getFields()),
211227
isTypeOf: type.isTypeOf,
212228
description: type.description,
213229
astNode: type.astNode,
214230
extensionASTNodes: type.extensionASTNodes || [],
215231
};
216-
return transformer.ObjectType
217-
? transformer.ObjectType(config)
232+
return this._transformer.ObjectType
233+
? this._transformer.ObjectType(config)
218234
: new GraphQLObjectType(config);
219235
} else if (isInterfaceType(type)) {
220236
const config = {
221237
name: type.name,
222-
fields: transformFields(type.getFields()),
238+
fields: this._transformFields(type.getFields()),
223239
resolveType: type.resolveType,
224240
description: type.description,
225241
astNode: type.astNode,
226242
extensionASTNodes: type.extensionASTNodes || [],
227243
};
228-
return transformer.InterfaceType
229-
? transformer.InterfaceType(config)
244+
return this._transformer.InterfaceType
245+
? this._transformer.InterfaceType(config)
230246
: new GraphQLInterfaceType(config);
231247
} else if (isUnionType(type)) {
232248
const config = {
233249
name: type.name,
234-
types: transformTypesThunk(type.getTypes()),
250+
types: this._transformTypesThunk(type.getTypes()),
235251
resolveType: type.resolveType,
236252
description: type.description,
237253
astNode: type.astNode,
238254
};
239-
return transformer.UnionType
240-
? transformer.UnionType(config)
255+
return this._transformer.UnionType
256+
? this._transformer.UnionType(config)
241257
: new GraphQLUnionType(config);
242258
} else if (isEnumType(type)) {
243259
const config = {
@@ -255,18 +271,18 @@ export function transformSchema(
255271
description: type.description,
256272
astNode: type.astNode,
257273
};
258-
return transformer.EnumType
259-
? transformer.EnumType(config)
274+
return this._transformer.EnumType
275+
? this._transformer.EnumType(config)
260276
: new GraphQLEnumType(config);
261277
} else if (isInputObjectType(type)) {
262278
const config = {
263279
name: type.name,
264-
fields: transformInputFields(type.getFields()),
280+
fields: this._transformInputFields(type.getFields()),
265281
description: type.description,
266282
astNode: type.astNode,
267283
};
268-
return transformer.InputObjectType
269-
? transformer.InputObjectType(config)
284+
return this._transformer.InputObjectType
285+
? this._transformer.InputObjectType(config)
270286
: new GraphQLInputObjectType(config);
271287
}
272288
throw new Error(`Unknown type: "${type}"`);

0 commit comments

Comments
 (0)
Please sign in to comment.