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.
For now, you can view the mapping of videogame IDs to their names in this sheet here.
Example #1 (Single Videogame)
- Request
- Response
query TournamentsByVideogame($perPage: Int!, $videogameId: ID!) {tournaments(query: {perPage: $perPagepage: 1sortBy: "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: "startAt asc"filter: {upcoming: truevideogameIds: $videogameIds}}) {nodes {idnameslug}}},{"perPage": 3,"videogameIds": [15, 24]}