In this example, we will query for upcoming tournaments filtered to particular videogames and in ascending order for their start date/time. In others words, "Give me the next x upcoming tournaments for Videogame(s)." The first example will be for a single videogame, and the second example will be for an array of videogames.
You can find the ID for a given game via the instructions in the get game id by name example query.
Example #1 (Single Videogame)
- Request
- Response
query TournamentsByVideogame($perPage: Int!, $videogameId: ID!) {tournaments(query: {perPage: $perPagepage: 1sortBy: "tournament.startAt asc"filter: {past: falsevideogameIds: [$videogameId]}}) {nodes {idnameslug}}},{"perPage": 3,"videogameId": 287}
Example #2 (Array of Videogames)
- Request
- Response
query TournamentsByVideogames($perPage: Int, $videogameIds: [ID]) {tournaments(query: {perPage: $perPagepage: 1sortBy: "tournament.startAt asc"filter: {upcoming: truevideogameIds: $videogameIds}}) {nodes {idnameslug}}},{"perPage": 3,"videogameIds": [15, 24]}