-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
With some faulty schemas or responses iface
in the following section can be null:
graphql-js/src/type/validate.js
Lines 596 to 603 in 6609d39
function getAllImplementsInterfaceNodes( | |
type: GraphQLObjectType, | |
iface: GraphQLInterfaceType, | |
): $ReadOnlyArray<NamedTypeNode> { | |
return getAllSubNodes(type, typeNode => typeNode.interfaces).filter( | |
ifaceNode => ifaceNode.name.value === iface.name, | |
); | |
} |
If fails then with [error] Cannot read property 'name' of null
. Adding a null check yields the much more understandable error message
Type $typename must only implement Interface types, it cannot implement null.