Skip to content

Fix UseSingleOrDefault ignoring explicit GraphQL field types#9220

Merged
michaelstaib merged 4 commits intomainfrom
mst/issue-5648
Feb 25, 2026
Merged

Fix UseSingleOrDefault ignoring explicit GraphQL field types#9220
michaelstaib merged 4 commits intomainfrom
mst/issue-5648

Conversation

@michaelstaib
Copy link
Copy Markdown
Member

@michaelstaib michaelstaib commented Feb 25, 2026

  • fix UseSingleOrDefault / UseFirstOrDefault type rewriting to preserve explicitly configured field GraphQL types
  • only rewrite field type when the original field type is a list shape inferred from the resolver result
  • add a regression test proving .Type<ObjectType<SingleOrDefaultActiveUser>>() is respected with UseSingleOrDefault

Fixes #5648

@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) 3289.79 0.00%
Ramping 2 (0-500-0 VUs) 3867.20 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 1.11ms 12.17ms 14.93ms 24.47ms 34.19ms 260.01ms
Ramping 2 1.16ms 50.95ms 56.66ms 99.21ms 144.20ms 318.18ms

Deep Recursion Query

Req/s Err%
Constant 2 (50 VUs) 772.33 0.00%
Ramping 2 (0-500-0 VUs) 909.59 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 11.64ms 55.58ms 62.76ms 80.60ms 100.69ms 606.36ms
Ramping 2 3.06ms 205.13ms 226.16ms 464.20ms 536.83ms 937.03ms

Variable Batching Throughput

Req/s Err%
Constant 2 (50 VUs) 5264.52 0.00%
Ramping 2 (0-500-0 VUs) 5127.53 0.00%
Response Times
Min Med Avg P90 P95 Max
Constant 2 0.18ms 8.85ms 9.38ms 15.71ms 18.80ms 53.19ms
Ramping 2 0.20ms 40.82ms 44.80ms 81.94ms 109.06ms 219.33ms

Runner 2 = benchmarking-2

Run 22419160302 • Commit 15081b1 • Wed, 25 Feb 2026 23:22:59 GMT

# Conflicts:
#	src/HotChocolate/Data/test/Data.EntityFramework.Tests/IntegrationTests.cs
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.

Using UseSingleOrDefault causes the GraphQLType to be ignored

1 participant