In these examples, we'll get specific events from a tournament. This can be extremely useful to empower event-specific queries by getting the specific event IDs that you want.
Example 1: Get All Events
This exmaple gets all events in a provided Tournament slug and returns back the ID of those Events and the Name. The Name is given by the tournament creator - so does not necessarily represent the game being played in that event, but the title of the event itself. IE: It could return "Melee Singles" instead of "Super Smash Brothers Melee Singles" or any other guaranteed format of data.
- Request
- Response
query TournamentEvents($tourneySlug:String!) {tournament(slug: $tourneySlug) {idnameevents {idname}}},{"tourneySlug":"genesis-x"}
Example 2: Get Events in Tournament by Game
This example gets all events within a given tournament by videogame ID (or ID's).
- Request
- Response
query TournamentEvents($tourneySlug:String, $videogameId:[ID]!) {tournament(slug: $tourneySlug) {idnameevents(filter:{videogameId: $videogameId}) {idname}}},{"tourneySlug":"genesis-x","videogameId":[1]}