Context
Every GraphQL query (GetTournaments, GetTournamentById) already moved off the pre-v16 pagination/projection middleware onto the QueryContext<T> + .With(query) pattern from GreenDonut.Data (see the HotChocolate v16 migration commit and the subsequent implementation-first type migration). Five mutations were never updated and still use the old [UseFirstOrDefault] [UseProjection] pattern, returning IQueryable<T> built from a .Where(...) clause:
TournamentMutations.CreateTournament
TournamentMutations.UpdateTournament
BracketMutations.GenerateBracket
BracketMutations.UpdateRound
ParticipantMutations.AddParticipant
This is inconsistent with the rest of the schema, and [UseProjection] was never adapted for the resolver-based fields (Owner, Bracket, Participants on Tournament; equivalent fields on Bracket) introduced by the implementation-first migration — it was designed to build a .Select() over plain bound properties, so there's an open question of whether it's doing anything useful for these payload types now, or is just dead weight (or a latent bug source, similar to the totalCount/IncludeTotalCount and email/BindMember bugs already found and fixed in this migration).
Task
Migrate all 5 mutations to the same pattern as TournamentQueries.GetTournamentById:
- Add a
QueryContext<T> query parameter (from GreenDonut.Data).
- Drop
[UseProjection].
- Apply
.With(query) to the final returned IQueryable<T> instead of returning the bare .Where(...) clause.
After migrating, check whether .AddProjections() in GraphQLExtensions.cs has any remaining call sites — if not, remove it along with the HotChocolate.Data projection registration, since nothing in the schema would use [UseProjection] anymore.
Verification
dotnet build — confirm compilation.
- Run
TournamentMutationTests, BracketMutationTests, ParticipantMutationTests — confirm no regressions, especially assertions that read owner/bracket/participants/etc. off a mutation payload.
- Manually verify a mutation payload query selecting only a subset of fields (e.g.
createTournament(...) { tournament { id name } }) still returns correctly-shaped data.
Context
Every GraphQL query (
GetTournaments,GetTournamentById) already moved off the pre-v16 pagination/projection middleware onto theQueryContext<T>+.With(query)pattern fromGreenDonut.Data(see the HotChocolate v16 migration commit and the subsequent implementation-first type migration). Five mutations were never updated and still use the old[UseFirstOrDefault] [UseProjection]pattern, returningIQueryable<T>built from a.Where(...)clause:TournamentMutations.CreateTournamentTournamentMutations.UpdateTournamentBracketMutations.GenerateBracketBracketMutations.UpdateRoundParticipantMutations.AddParticipantThis is inconsistent with the rest of the schema, and
[UseProjection]was never adapted for the resolver-based fields (Owner,Bracket,ParticipantsonTournament; equivalent fields onBracket) introduced by the implementation-first migration — it was designed to build a.Select()over plain bound properties, so there's an open question of whether it's doing anything useful for these payload types now, or is just dead weight (or a latent bug source, similar to thetotalCount/IncludeTotalCountandemail/BindMemberbugs already found and fixed in this migration).Task
Migrate all 5 mutations to the same pattern as
TournamentQueries.GetTournamentById:QueryContext<T> queryparameter (fromGreenDonut.Data).[UseProjection]..With(query)to the final returnedIQueryable<T>instead of returning the bare.Where(...)clause.After migrating, check whether
.AddProjections()inGraphQLExtensions.cshas any remaining call sites — if not, remove it along with theHotChocolate.Dataprojection registration, since nothing in the schema would use[UseProjection]anymore.Verification
dotnet build— confirm compilation.TournamentMutationTests,BracketMutationTests,ParticipantMutationTests— confirm no regressions, especially assertions that readowner/bracket/participants/etc. off a mutation payload.createTournament(...) { tournament { id name } }) still returns correctly-shaped data.