Skip to content

Fix #6953 projection cast on explicit union root fields#9260

Open
michaelstaib wants to merge 1 commit intomainfrom
mst/issue-6953
Open

Fix #6953 projection cast on explicit union root fields#9260
michaelstaib wants to merge 1 commit intomainfrom
mst/issue-6953

Conversation

@michaelstaib
Copy link
Copy Markdown
Member

Fixes #6953

Summary

  • add a regression test for [UseProjection] on a root field returning IQueryable<Base> while exposing ListType<UnionType>
  • reproduce both reported query shapes (__typename only and fragment selections)
  • fix QueryableProjectionProvider to use TEntityType when the unwrapped selection runtime type is object, so the generated projection lambda keeps the correct source parameter type

Test Commands

  • dotnet test src/HotChocolate/Data/test/Data.Tests/HotChocolate.Data.Tests.csproj --filter "FullyQualifiedName~Issue6953Tests|FullyQualifiedName~Issue5528ReproTests" --nologo

Results

  • Passed on net8.0/net9.0/net10.0 (Failed: 0)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2026

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant 2 (50 VUs) 3214.99 0.00%
Ramping 2 (0-500-0 VUs) 3936.78 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 1.11ms 12.51ms 15.26ms 24.78ms 34.11ms 259.29ms
Ramping 2 1.02ms 50.32ms 55.74ms 97.13ms 137.08ms 280.02ms

Deep Recursion Query

Req/s Err%
Constant 2 (50 VUs) 765.78 0.00%
Ramping 2 (0-500-0 VUs) 926.82 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 9.00ms 55.22ms 63.24ms 81.44ms 102.78ms 705.85ms
Ramping 2 2.89ms 199.84ms 222.79ms 457.33ms 515.91ms 971.77ms

Variable Batching Throughput

Req/s Err%
Constant 2 (50 VUs) 5603.22 0.00%
Ramping 2 (0-500-0 VUs) 5275.31 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 0.15ms 8.31ms 8.82ms 14.76ms 17.93ms 56.75ms
Ramping 2 0.19ms 38.90ms 43.54ms 81.57ms 106.15ms 220.44ms

Runner 2 = benchmarking-2

Run 22496070137 • Commit d597e04 • Fri, 27 Feb 2026 17:18:25 GMT

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.

Projection on UnionTypes leads to an Unable to cast Exception

1 participant