Skip to content

Commit

Permalink
fixed issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
viniychuk committed Jul 13, 2016
1 parent fd10db6 commit ea66d00
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/Execution/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected function getPreResolvedValue($contextValue, FieldAst $fieldAst, Abstra
}

if ($resolveFunction = $field->getConfig()->getResolveFunction()) {
$resolveInfo = new ResolveInfo($field, [$fieldAst], $field->getType(), $this->executionContext);
$resolveInfo = new ResolveInfo($field, [$fieldAst], $field->getType(), $this->executionContext);

$resolverValue = $resolveFunction($resolved ? $resolverValue : $contextValue, $fieldAst->getKeyValueArguments(), $resolveInfo);
}
Expand Down Expand Up @@ -322,18 +322,22 @@ protected function processQueryFields($query, AbstractType $queryType, $resolved

if ($fieldAst->getName() == self::TYPE_NAME_QUERY) {
$fieldResolvedValue = [$alias => $queryType->getName()];
} elseif ($fieldAst instanceof Query) {
$fieldValue = $this->processQueryAST($fieldAst, $currentType->getField($fieldAst->getName()), $resolvedValue);
$fieldResolvedValue = [$alias => $fieldValue];
} elseif ($fieldAst instanceof FieldAst) {

} else {
if (!$this->resolveValidator->objectHasField($currentType, $fieldAst)) {
$fieldResolvedValue = null;
} else {
$fieldResolvedValue = [
$alias => $this->processFieldAST($fieldAst, $currentType->getField($fieldAst->getName()), $resolvedValue)
];
if ($fieldAst instanceof Query) {
$queryAst = $currentType->getField($fieldAst->getName());
$fieldValue = $queryAst ? $this->processQueryAST($fieldAst, $queryAst, $resolvedValue) : null;
$fieldResolvedValue = [$alias => $fieldValue];
} elseif ($fieldAst instanceof FieldAst) {
$fieldResolvedValue = [
$alias => $this->processFieldAST($fieldAst, $currentType->getField($fieldAst->getName()), $resolvedValue)
];
}
}


}
}

Expand Down

0 comments on commit ea66d00

Please sign in to comment.