Fixed bug with failing error reporting for mismatching interface / union implementations

This commit is contained in:
vladar 2015-10-25 19:35:36 +06:00
parent ea4d43f00f
commit c81605bfb1

View File

@ -579,7 +579,7 @@ class Executor
// than continuing execution. // than continuing execution.
if (false === $runtimeType->isTypeOf($result, $info)) { if (false === $runtimeType->isTypeOf($result, $info)) {
throw new Error( throw new Error(
"Expected value of type $runtimeType but got: $result.", "Expected value of type $runtimeType but got: " . Utils::getVariableType($result),
$fieldASTs $fieldASTs
); );
} }
@ -590,8 +590,8 @@ class Executor
for ($i = 0; $i < count($fieldASTs); $i++) { for ($i = 0; $i < count($fieldASTs); $i++) {
// Get memoized value if it exists // Get memoized value if it exists
$uid = self::getFieldUid($fieldASTs[$i], $runtimeType); $uid = self::getFieldUid($fieldASTs[$i], $runtimeType);
if (isset($exeContext->memoized['collectSubFields'][$uid][$runtimeType->name])) { if (isset($exeContext->memoized['collectSubFields'][$uid])) {
$subFieldASTs = $exeContext->memoized['collectSubFields'][$uid][$runtimeType->name]; $subFieldASTs = $exeContext->memoized['collectSubFields'][$uid];
} }
else { else {
$selectionSet = $fieldASTs[$i]->selectionSet; $selectionSet = $fieldASTs[$i]->selectionSet;
@ -603,7 +603,7 @@ class Executor
$subFieldASTs, $subFieldASTs,
$visitedFragmentNames $visitedFragmentNames
); );
$exeContext->memoized['collectSubFields'][$uid][$runtimeType->name] = $subFieldASTs; $exeContext->memoized['collectSubFields'][$uid] = $subFieldASTs;
} }
} }
} }