-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
Pull Request Test Coverage Report for Build 214
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I added a few comments though.
*/ | ||
private function getFieldNameKey(FieldNode $node) | ||
{ | ||
return $node->getAlias() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should a hasAlias
method to the associated trait and use that instead.
|
||
$result = $this->resolveField($parentType, | ||
$source, | ||
[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support arguments yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do support args
$inputValues = $fieldNode->getArguments() ?? [];
$args = [];
foreach ($inputValues as $value) {
if ($value instanceof ArgumentNode) {
$args[] = $value->getValue()->getValue();
} elseif ($value instanceof InputValueDefinitionNode) {
$args[] = $value->getDefaultValue()->getValue();
}
}
src/Execution/ExecutionStrategy.php
Outdated
$fields | ||
); | ||
|
||
$subResult = array_merge_recursive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a costy operation. We should add a TODO to benchmark it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to refactor this very soon :D
$fields = $this->collectFields( | ||
$parentType, | ||
$fieldNode->getSelectionSet(), | ||
new \ArrayObject(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use []
instead?
ce75112
to
f616829
Compare
I have to improve the implementation a lot more but basically now the execution can execute multiple fragments.
It's done in a recursive way which I think not so good. I will try to do it in non-recursive way.