Skip to content

Preserve Kotlin list-item nullability inside Uni wrappers - #2563

Merged
jmartisk merged 1 commit into
smallrye:mainfrom
MdTanwer:fix-kotlin-uni-list-nullability
Jul 27, 2026
Merged

jmartisk merged 1 commit into
smallrye:mainfrom
MdTanwer:fix-kotlin-uni-list-nullability

Conversation

@MdTanwer

@MdTanwer MdTanwer commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix Kotlin GraphQL schema generation so Uni<List<String>> (and similar Mutiny/CompletionStage wrappers) keeps list-item nullability from Kotlin metadata, producing [String!]! instead of [String]!.
  • Recursively apply nullability across the wrapper chain in OperationCreator, while still only letting collection-like argument wrappers control argument-level nullability.
  • Update Field.getGraphQLType() to skip non-collection wrappers when rendering nested list types, and add schema-builder coverage for the Uni+List nullability matrix.

Fixes: quarkusio/quarkus#48350

@MdTanwer
MdTanwer force-pushed the fix-kotlin-uni-list-nullability branch from d34b748 to 508b36e Compare July 11, 2026 05:26
MdTanwer added a commit to MdTanwer/smallrye-graphql that referenced this pull request Jul 22, 2026
Address review feedback on PR smallrye#2563.

Co-authored-by: Cursor <cursoragent@cursor.com>
@MdTanwer
MdTanwer requested review from jmartisk and mskacelik July 22, 2026 11:52
Kotlin metadata was only inspected at the first wrapper level, so
Uni<List<String>> lost item nullability and became [String]! instead of
[String!]!. Walk the full wrapper chain and teach getGraphQLType() to
skip non-collection wrappers when rendering nested lists.

Fixes: quarkusio/quarkus#48350
@MdTanwer
MdTanwer force-pushed the fix-kotlin-uni-list-nullability branch from 3d409a5 to 923aa2b Compare July 22, 2026 11:53
@jmartisk
jmartisk merged commit 8affa9d into smallrye:main Jul 27, 2026
5 of 7 checks passed
@jmartisk

Copy link
Copy Markdown
Member

Thanks!

@github-actions github-actions Bot added this to the 2.12.3 milestone Jul 27, 2026
@MdTanwer
MdTanwer deleted the fix-kotlin-uni-list-nullability branch July 27, 2026 07:50
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 Kotlin list item nullability is lost with Mutiny

3 participants