Skip to content

Commit 4d195cc

Browse files
committed
fix initial value pass by reference error in executeFields
1 parent 909f5f0 commit 4d195cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Execution/Executor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ private function shouldIncludeNode(ExecutionContext $executionContext, $node): b
234234
*/
235235
public function executeFields(ExecutionContext $executionContext, GraphQLObjectType $parentType, $sourceValue, $path, $fields)
236236
{
237+
$initial = [];
237238
return array_reduce(array_keys($fields), function (&$results, $responseName) use ($executionContext, $parentType, $sourceValue, $path, $fields) {
238239
$fieldNodes = $fields[$responseName];
239240
$fieldPath = [$path, $responseName, $parentType->getName()];
@@ -252,7 +253,7 @@ public function executeFields(ExecutionContext $executionContext, GraphQLObjectT
252253

253254
$results[$responseName] = $result;
254255
return $results;
255-
}, []);
256+
}, $initial);
256257
}
257258

258259
/**

0 commit comments

Comments
 (0)