Skip to content

feat: introduce functionality to query a user's tournament history - #142

Merged
Dejmenek merged 9 commits into
mainfrom
feat/140-add-wontournamentsplayedtournaments-fields-to-applicationuser
Sep 12, 2026
Merged

Dejmenek merged 9 commits into
mainfrom
feat/140-add-wontournamentsplayedtournaments-fields-to-applicationuser

Conversation

@Dejmenek

Copy link
Copy Markdown
Owner

Summary

This pull request introduces functionality to query a user's tournament history (wonTournaments and playedTournaments) via GraphQL, both directly through the me query and indirectly via the owner field of a tournament. It also includes database updates, new tests, and performance optimizations.

Changes

  • TournamentQueryTests.cs and UserQueryTests.cs: Added new test cases for wonTournaments and playedTournaments validation.
  • ResponseModels.cs: Extended ApplicationUserNode and UserNode with WonTournaments and PlayedTournaments fields.
  • DatabaseSeeder.cs: Added Tournament 16 with a completed bracket for testing.
  • ApplicationUserResolvers.cs: Added resolvers for GetPlayedTournaments and GetWonTournaments with pagination, filtering, and sorting.
  • UserTournamentsService.cs: Implemented service to fetch paginated tournament data for users, leveraging batching for performance.

Introduced `UserTournamentsService` to handle fetching and
displaying tournaments a user has participated in or won.
Updated `ApplicationUserResolvers` with new GraphQL resolvers
(`GetPlayedTournaments` and `GetWonTournaments`) supporting
pagination, filtering, and sorting.

Added `UserPlayedTournamentIdsDataLoaders` and
`UserWonTournamentIdsDataLoaders` for efficient batch fetching
of tournament IDs using `Entity Framework`. Implemented
helper methods in `UserTournamentsService` to handle paginated
queries and integrate with batching contexts.
Added `WonTournaments` and `PlayedTournaments` properties to the `ApplicationUserNode` and `UserNode` classes in `ResponseModels.cs`. These properties, of type `TournamentsConnection?`, enable tracking of tournaments a user has won and participated in.
@Dejmenek Dejmenek linked an issue Sep 12, 2026 that may be closed by this pull request
@Dejmenek
Dejmenek merged commit c749ce5 into main Sep 12, 2026
3 checks passed
@Dejmenek
Dejmenek deleted the feat/140-add-wontournamentsplayedtournaments-fields-to-applicationuser branch September 12, 2026 15:04
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.

Add wonTournaments/playedTournaments fields to ApplicationUser

1 participant