Repository navigation
Fix recursive merging of alias-aware field selections - #1997
Open
developerjillur wants to merge 1 commit into
Open
developerjillur wants to merge 1 commit into
developerjillur wants to merge 1 commit into
Conversation
developerjillur
marked this pull request as ready for review
November 1, 2026 13:37
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1767
Repeated selections in
getFieldSelectionWithAliases()currently passTypeinstances througharray_merge_recursive(). This converts them into arrays and can recurse into cyclic type configurations. It also combines repeated scalar/list argument values instead of preserving their original shape.Use
array_replace_recursive()for the alias-aware selection merges and combine nested selection sets when a field is repeated. This retains the original type instances, arguments, and selected subfields. Add twelve regression cases covering named and inline fragments in either order, duplicate root and nested fields, and cyclic object configurations.Validation
composer test -- tests/Type/ResolveInfoTest.php: 19 tests, 128 assertions, passing, including all twelve new cases.composer test: exit 0; 2101 tests, 738804 assertions. PHP 8.5.7 reports 3 warnings, 1 PHPUnit deprecation, 14 skipped and 4 incomplete tests. A task-local 512 MB PHP limit was used because the default 128 MB limit is insufficient for the existing large validator test.composer stan -- --no-progress --memory-limit=512M --debug: no errors.git diff --check: clean.Changelog
Fixed
ResolveInfo::getFieldSelectionWithAliases()