Skip to content

Commit

Permalink
Ensure unaliasedPath does not grow for each list item
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia authored Jun 19, 2024
1 parent a525e5b commit 4ddba16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ You can find and compare releases at the [GitHub release page](https://github.co

## Unreleased

## v15.12.4

### Fixed

- Ensure unaliasedPath does not grow for each list item https://github.com/webonyx/graphql-php/pull/1579

## v15.12.3

### Fixed
Expand Down
10 changes: 5 additions & 5 deletions src/Executor/ReferenceExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1012,13 +1012,13 @@ protected function completeListValue(
$containsPromise = false;
$completedItems = [];
foreach ($results as $item) {
$fieldPath = [...$path, $i];
$info->path = $fieldPath;
$unaliasedPath = [...$unaliasedPath, $i];
$info->unaliasedPath = $unaliasedPath;
$itemPath = [...$path, $i];
$info->path = $itemPath;
$itemUnaliasedPath = [...$unaliasedPath, $i];
$info->unaliasedPath = $itemUnaliasedPath;
++$i;

$completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $fieldPath, $unaliasedPath, $item, $contextValue);
$completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $itemPath, $itemUnaliasedPath, $item, $contextValue);

if (! $containsPromise && $this->getPromise($completedItem) !== null) {
$containsPromise = true;
Expand Down

0 comments on commit 4ddba16

Please sign in to comment.