Skip to content

Commit c81605b

Browse files
committed
Fixed bug with failing error reporting for mismatching interface / union implementations
1 parent ea4d43f commit c81605b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Executor/Executor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ private static function completeValue(ExecutionContext $exeContext, Type $return
579579
// than continuing execution.
580580
if (false === $runtimeType->isTypeOf($result, $info)) {
581581
throw new Error(
582-
"Expected value of type $runtimeType but got: $result.",
582+
"Expected value of type $runtimeType but got: " . Utils::getVariableType($result),
583583
$fieldASTs
584584
);
585585
}
@@ -590,8 +590,8 @@ private static function completeValue(ExecutionContext $exeContext, Type $return
590590
for ($i = 0; $i < count($fieldASTs); $i++) {
591591
// Get memoized value if it exists
592592
$uid = self::getFieldUid($fieldASTs[$i], $runtimeType);
593-
if (isset($exeContext->memoized['collectSubFields'][$uid][$runtimeType->name])) {
594-
$subFieldASTs = $exeContext->memoized['collectSubFields'][$uid][$runtimeType->name];
593+
if (isset($exeContext->memoized['collectSubFields'][$uid])) {
594+
$subFieldASTs = $exeContext->memoized['collectSubFields'][$uid];
595595
}
596596
else {
597597
$selectionSet = $fieldASTs[$i]->selectionSet;
@@ -603,7 +603,7 @@ private static function completeValue(ExecutionContext $exeContext, Type $return
603603
$subFieldASTs,
604604
$visitedFragmentNames
605605
);
606-
$exeContext->memoized['collectSubFields'][$uid][$runtimeType->name] = $subFieldASTs;
606+
$exeContext->memoized['collectSubFields'][$uid] = $subFieldASTs;
607607
}
608608
}
609609
}

0 commit comments

Comments
 (0)