Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Move the if-block to on top of the function
Browse files Browse the repository at this point in the history
  • Loading branch information
hungneox committed Sep 20, 2018
1 parent 496be9e commit 3659e65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Execution/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,14 @@ protected function defaultTypeResolver(
ResolveInfo $info,
AbstractTypeInterface $abstractType
) {
/** @var ObjectType[] $possibleTypes */
$possibleTypes = $info->getSchema()->getPossibleTypes($abstractType);
$promisedIsTypeOfResults = [];

if (\is_array($value) && isset($value['__typename'])) {
return $value['__typename'];
}

/** @var ObjectType[] $possibleTypes */
$possibleTypes = $info->getSchema()->getPossibleTypes($abstractType);
$promisedIsTypeOfResults = [];

foreach ($possibleTypes as $index => $type) {
$isTypeOfResult = $type->isTypeOf($value, $context, $info);

Expand Down

0 comments on commit 3659e65

Please sign in to comment.