Skip to content

Add pagination to nested list fields #116

Description

@Dejmenek

Description

While the root GetTournaments query is capped at 100 ([UsePaging(MaxPageSize = 100, ...)]), none of the nested list fields it can return are paginated: Tournament.Participants (plain ListType<TournamentParticipantType>), Bracket.Matches (plain ListType<MatchType>), and GetMatchesForRound (has [UseProjection]/[UseSorting] but no [UsePaging]/[UseFiltering]).

Expected behavior

Nested list fields reachable from a query should be bounded the same way the root query is.

Actual behavior

{ tournaments(first: 100) { nodes { participants { participantId } bracket { matches { id } } } } } is only 3 levels deep, well inside the 8-level depth budget, but the outer cap of 100 does nothing to bound the participants/matches arrays nested inside each of those 100 tournaments. A tournament with a large participant/match count turns this into a large, unbounded response the server has to materialize and serialize, with no cost mechanism to stop it today.

Affected files

TournamentAPI/Tournaments/TournamentType.cs (Participants), TournamentAPI/Brackets/BracketType.cs (Matches), TournamentAPI/Matches/MatchQueries.cs (GetMatchesForRound)

Notes

Needs to be implemented later after migrating to HotChocolate v16.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions