Skip to content

Commit 970ca0b

Browse files
committed
Extend validation of type reference
1 parent 1bac625 commit 970ca0b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Types/EntityObjectType.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ private function validateReferenceResolver(): void
143143
*/
144144
private function validateReferenceKeys(array $ref): void
145145
{
146-
Utils::invariant(isset($ref[FederatedSchema::RESERVED_FIELD_TYPE_NAME]), 'Type name must be provided in the reference.');
146+
Utils::invariant(
147+
isset($ref[FederatedSchema::RESERVED_FIELD_TYPE_NAME])
148+
&& $ref[FederatedSchema::RESERVED_FIELD_TYPE_NAME] === $this->config['name'],
149+
'Type name must be provided in the reference.'
150+
);
147151
}
148152

149153
/**

0 commit comments

Comments
 (0)