Skip to content

Commit

Permalink
Fix #2504 access field astNode's type by optional chaining (#2513)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephktcheung authored May 7, 2020
1 parent 6cd7f94 commit 122b305
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/type/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function validateTypeImplementsInterface(
`Interface field ${iface.name}.${fieldName} expects type ` +
`${inspect(ifaceField.type)} but ${type.name}.${fieldName} ` +
`is type ${inspect(typeField.type)}.`,
[ifaceField.astNode.type, typeField.astNode.type],
[ifaceField.astNode?.type, typeField.astNode?.type],
);
}

Expand All @@ -382,7 +382,7 @@ function validateTypeImplementsInterface(
`expects type ${inspect(ifaceArg.type)} but ` +
`${type.name}.${fieldName}(${argName}:) is type ` +
`${inspect(typeArg.type)}.`,
[ifaceArg.astNode.type, typeArg.astNode.type],
[ifaceArg.astNode?.type, typeArg.astNode?.type],
);
}

Expand Down

0 comments on commit 122b305

Please sign in to comment.