Skip to content

feat(graphql): map scalar arrays to typed lists - #8619

Merged
soyuka merged 3 commits into
api-platform:mainfrom
soyuka:feat/graphql-scalar-array-2128
Nov 25, 2026
Merged

soyuka merged 3 commits into
api-platform:mainfrom
soyuka:feat/graphql-scalar-array-2128

Conversation

@soyuka

@soyuka soyuka commented Oct 1, 2026

Copy link
Copy Markdown
Member
Q A
Branch? main
Tickets Closes #2128
License MIT
Doc PR todo

Properties typed as a list of scalars (list<string>, string[], array<int, int>, iterable<float>, list<?bool>) are now exposed as [String] / [Int] / [Float] / [Boolean] in the GraphQL schema instead of the Iterable scalar. Dictionaries (array<string, X>), mixed, unions and nested lists stay Iterable.

Test: src/GraphQl/Tests/Type/TypeConverterTest.php::testConvertScalarCollectionType.

BC: the schema type of existing scalar-array fields changes, clients declaring an Iterable variable for them will break. Needs an UPGRADE note, or should this be opt-in? Elements are nullable ([String], not [String!]).

@soyuka soyuka added this to the 5.1 milestone Nov 24, 2026
@soyuka
soyuka merged commit af34375 into api-platform:main Nov 25, 2026
107 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Graphql] Handle the type for an array of a scalar-type

1 participant