Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination on game scores api #11457

Closed
mattrussell36 opened this issue Jul 15, 2024 · 0 comments · Fixed by #11458
Closed

Pagination on game scores api #11457

mattrussell36 opened this issue Jul 15, 2024 · 0 comments · Fixed by #11458
Assignees

Comments

@mattrussell36
Copy link
Contributor

mattrussell36 commented Jul 15, 2024

Pagination is not working on game gameTeamScores query. The cursor used in this example is the first result of the previous query which did not use a cursor and fetched the last 3 results

Query

query Scores(
  $gameId: ID!
  $partyId: ID!
  $epochFrom: Int
  $pagination: Pagination
) {
  gameTeamScores(filter: { gameIds: [$gameId], epochFrom: $epochFrom }) {
    edges {
      cursor
      node {
        teamId
      }
    }
  }
}

Variables

{
  "gameId": "a2e2e92bd58e2706c4b9640675ae5bc19dad409dd290f262f5da93bcc4015414",
  "epochFrom": 15720,
  "pagination": {
    "last": 3,
    "before": "eyJnYW1lX2lkIjoiYTJlMmU5MmJkNThlMjcwNmM0Yjk2NDA2NzVhZTViYzE5ZGFkNDA5ZGQyOTBmMjYyZjVkYTkzYmNjNDAxNTQxNCIsInRlYW1faWQiOiJiMWRkZWJhY2QzOGYyYTI4MzljYTE3ZjU3ZGY0OGNjYTAzNDJmODNkNGViYWE5OGNlNTQyZGFkMTZlNDQ4MjRiIiwiZXBvY2hfaWQiOjE1NzM2LCJ2ZWdhX3RpbWUiOiIyMDI0LTA3LTE1VDEwOjQ5OjI3LjU0NTI4OFoifQ=="
  }
}

Result

{
  "errors": [
    {
      "message": "building cursor predicate: no field matching column name t1.game_id",
      "path": [
        "gameTeamScores"
      ],
      "extensions": {
        "code": 13,
        "type": "Internal"
      }
    }
  ],
  "data": {
    "gameTeamScores": null,
    "epoch": {
      "id": "15736"
    }
  }
}

Additionally, the sort order appears to be showing most recent epoch at the bottom.

This should be reversed, we will want most recent epoch at the top because once we get lots of data here and pagination starts being a factor we'll clearly want to start the views looking at the most recent epochs and then allow the users to query further back into history if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants