@@ -136,22 +136,18 @@ export function buildASTSchema(
136
136
throw new Error ( 'Nothing constructed for ' + typeName ) ;
137
137
}
138
138
innerTypeMap [ typeName ] = innerTypeDef ;
139
- if ( astMap [ typeName ] . kind === INTERFACE_DEFINITION ) {
140
- // Now that we've created and cached our interface, ensure
141
- // we create all implementations to point to it.
142
- makeInterfaceImplementations ( astMap [ typeName ] ) ;
143
- }
144
139
return buildWrappedType ( innerTypeDef , typeAST ) ;
145
140
} ;
146
141
}
147
142
148
-
149
143
var produceTypeDef = getTypeDefProducer ( ast ) ;
150
144
151
145
if ( isNullish ( astMap [ queryTypeName ] ) ) {
152
146
throw new Error ( `Type ${ queryTypeName } not found in document` ) ;
153
147
}
154
148
149
+ ast . definitions . forEach ( produceTypeDef ) ;
150
+
155
151
var queryType = produceTypeDef ( astMap [ queryTypeName ] ) ;
156
152
var schema ;
157
153
if ( isNullish ( mutationTypeName ) ) {
@@ -216,16 +212,6 @@ export function buildASTSchema(
216
212
return def . interfaces . map ( inter => produceTypeDef ( inter ) ) ;
217
213
}
218
214
219
- function makeInterfaceImplementations ( inter : InterfaceDefinition ) {
220
- var interName = inter . name . value ;
221
- var types = ast . definitions . filter ( def => def . kind === TYPE_DEFINITION ) ;
222
- var implementingTypes = types . filter ( def => {
223
- var names = def . interfaces . map ( namedType => namedType . name . value ) ;
224
- return names . indexOf ( interName ) !== - 1 ;
225
- } ) ;
226
- implementingTypes . forEach ( produceTypeDef ) ;
227
- }
228
-
229
215
function makeInputValues ( values : Array < InputValueDefinition > ) {
230
216
return keyValMap (
231
217
values ,
0 commit comments