opeik / runback

Broadcast graphics for fighting games
GNU General Public License v3.0
6 stars 3 forks source link

Add top 8 bracket viewer overlay #1

Open opeik opened 3 years ago

opeik commented 3 years ago

After poking around the smash.gg API, I believe these queries are what I'm after.

Fetch the phases:

query EventStandings($eventId: ID!) {
  event(id: $eventId) {
    id
    name
    phases {
      id
      bracketType
      name
      phaseOrder
    }
  }
}

Fetch the phase sets:

query PhaseSets($phaseId: ID!, $page: Int!, $perPage: Int!) {
  phase(id: $phaseId) {
    id
    name
    sets(
      page: $page
      perPage: $perPage
      sortType: CALL_ORDER
    ){
      pageInfo {
        total
        totalPages
      }
      nodes {
        id
        round
        slots {
          entrant {
            id
            name
          }
        }
      }
    }
  }
}

Fetch the set:

query set($setId: ID!) {
  set(id: $setId) {
    id
    slots {
      standing {
        entrant {
          name
        }
        stats {
          score {
            value
          }
        }
      }
    }
  }
}