@@ -148,9 +148,7 @@ function resolveMemberCoordinate(
148148 ! isInterfaceType ( type )
149149 ) {
150150 throw new Error (
151- `Expected ${ inspect (
152- typeName ,
153- ) } to be an Enum, Input Object, Object or Interface type.`,
151+ `Expected ${ inspect ( typeName ) } to be an Enum, Input Object, Object or Interface type.` ,
154152 ) ;
155153 }
156154
@@ -185,7 +183,7 @@ function resolveMemberCoordinate(
185183 // 6. Otherwise:
186184 // 1. Let {fieldName} be the value of the second {Name}.
187185 const fieldName = schemaCoordinate . memberName . value ;
188- const field = type . getFields ( ) [ fieldName ] ;
186+ const field = schema . getField ( type , fieldName ) ;
189187
190188 // 2. Return the field of {type} named {fieldName} if it exists.
191189 if ( field == null ) {
@@ -222,21 +220,19 @@ function resolveArgumentCoordinate(
222220 // 4. Let {fieldName} be the value of the second {Name}.
223221 // 5. Let {field} be the field of {type} named {fieldName}.
224222 const fieldName = schemaCoordinate . fieldName . value ;
225- const field = type . getFields ( ) [ fieldName ] ;
223+ const field = schema . getField ( type , fieldName ) ;
226224
227225 // 7. Assert: {field} must exist.
228226 if ( field == null ) {
229227 throw new Error (
230- `Expected ${ inspect ( fieldName ) } to exist as a field of type ${ inspect (
231- typeName ,
232- ) } in the schema.`,
228+ `Expected ${ inspect ( fieldName ) } to exist as a field of type ${ inspect ( typeName ) } in the schema.` ,
233229 ) ;
234230 }
235231
236232 // 7. Let {fieldArgumentName} be the value of the third {Name}.
237233 const fieldArgumentName = schemaCoordinate . argumentName . value ;
238234 const fieldArgument = field . args . find (
239- ( arg : GraphQLArgument ) => arg . name === fieldArgumentName ,
235+ ( arg ) => arg . name === fieldArgumentName ,
240236 ) ;
241237
242238 // 8. Return the argument of {field} named {fieldArgumentName} if it exists.
@@ -248,7 +244,7 @@ function resolveArgumentCoordinate(
248244}
249245
250246/**
251- * DirectiveCoordinate : \ @ Name
247+ * DirectiveCoordinate : @ Name
252248 */
253249function resolveDirectiveCoordinate (
254250 schema : GraphQLSchema ,
@@ -267,7 +263,7 @@ function resolveDirectiveCoordinate(
267263}
268264
269265/**
270- * DirectiveArgumentCoordinate : \ @ Name ( Name : )
266+ * DirectiveArgumentCoordinate : @ Name ( Name : )
271267 */
272268function resolveDirectiveArgumentCoordinate (
273269 schema : GraphQLSchema ,
@@ -281,9 +277,7 @@ function resolveDirectiveArgumentCoordinate(
281277 // 3. Assert {directive} must exist.
282278 if ( ! directive ) {
283279 throw new Error (
284- `Expected ${ inspect (
285- directiveName ,
286- ) } to be defined as a directive in the schema.`,
280+ `Expected ${ inspect ( directiveName ) } to be defined as a directive in the schema.` ,
287281 ) ;
288282 }
289283
0 commit comments