Skip to content

Commit 4ddba16

Browse files
authored
Ensure unaliasedPath does not grow for each list item
1 parent a525e5b commit 4ddba16

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ You can find and compare releases at the [GitHub release page](https://github.co
99

1010
## Unreleased
1111

12+
## v15.12.4
13+
14+
### Fixed
15+
16+
- Ensure unaliasedPath does not grow for each list item https://github.com/webonyx/graphql-php/pull/1579
17+
1218
## v15.12.3
1319

1420
### Fixed

src/Executor/ReferenceExecutor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,13 +1012,13 @@ protected function completeListValue(
10121012
$containsPromise = false;
10131013
$completedItems = [];
10141014
foreach ($results as $item) {
1015-
$fieldPath = [...$path, $i];
1016-
$info->path = $fieldPath;
1017-
$unaliasedPath = [...$unaliasedPath, $i];
1018-
$info->unaliasedPath = $unaliasedPath;
1015+
$itemPath = [...$path, $i];
1016+
$info->path = $itemPath;
1017+
$itemUnaliasedPath = [...$unaliasedPath, $i];
1018+
$info->unaliasedPath = $itemUnaliasedPath;
10191019
++$i;
10201020

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

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

0 commit comments

Comments
 (0)