Skip to content

Fix projection for fluent union list fields#9222

Merged
michaelstaib merged 2 commits intomainfrom
mst/issue-5528
Feb 25, 2026
Merged

Fix projection for fluent union list fields#9222
michaelstaib merged 2 commits intomainfrom
mst/issue-5528

Conversation

@michaelstaib
Copy link
Copy Markdown
Member

@michaelstaib michaelstaib commented Feb 25, 2026

Summary

  • fix QueryableProjectionScopeExtensions.CreateSelection to project list/array/set items using the target member element type instead of always using scope runtime type
  • this prevents Expression.Bind type mismatches for fluent UnionType list fields where the union runtime type defaults to object
  • add regression test reproducing List of union type inside object type causes an exception when using fluent API #5528 with UseProjection over a list field configured as a fluent union

Validation

  • dotnet test src/HotChocolate/Data/test/Data.Tests/ --filter FullyQualifiedName~Issue5528ReproTests.List_Of_Union_With_Fluent_Api_And_Projection_Does_Not_Throw -f net10.0
  • dotnet test src/HotChocolate/Data/test/Data.Tests/ --filter FullyQualifiedName~QueryContextUnionProjectionTests -f net10.0
  • dotnet test src/HotChocolate/Data/test/Data.Projections.Tests/ -f net10.0

Fixes #5528

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 25, 2026

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant 2 (50 VUs) 3135.58 0.00%
Ramping 2 (0-500-0 VUs) 3768.68 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 1.21ms 12.73ms 15.64ms 25.75ms 35.75ms 262.48ms
Ramping 2 1.27ms 52.67ms 58.15ms 100.66ms 144.32ms 287.19ms

Deep Recursion Query

Req/s Err%
Constant 2 (50 VUs) 742.99 0.00%
Ramping 2 (0-500-0 VUs) 883.05 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 6.96ms 58.08ms 65.03ms 82.46ms 100.53ms 734.03ms
Ramping 2 3.18ms 210.47ms 233.54ms 488.07ms 547.96ms 868.16ms

Variable Batching Throughput

Req/s Err%
Constant 2 (50 VUs) 5734.12 0.00%
Ramping 2 (0-500-0 VUs) 5229.55 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 0.15ms 8.15ms 8.62ms 14.45ms 17.32ms 82.08ms
Ramping 2 0.18ms 39.78ms 43.92ms 81.76ms 105.16ms 233.73ms

Runner 2 = benchmarking-2

Run 22421092140 • Commit 50d3b77 • Thu, 26 Feb 2026 00:03:08 GMT

@michaelstaib michaelstaib added the 🔍 investigate Indicates that an issue or pull request needs more information. label Feb 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (f64f691) to head (a83c12e).

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #9222   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List of union type inside object type causes an exception when using fluent API

1 participant