From 3d743e7c22c3d2f1cc2ecc55eb5e404f90bd4cfc Mon Sep 17 00:00:00 2001 From: Sendou Date: Mon, 23 Mar 2020 20:57:06 +0200 Subject: [PATCH] detailed tournament graphql schemas --- graphql-schemas/detailedtournament.js | 73 +++++++++++++++++---------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/graphql-schemas/detailedtournament.js b/graphql-schemas/detailedtournament.js index ec9885e28..b2b484d0f 100644 --- a/graphql-schemas/detailedtournament.js +++ b/graphql-schemas/detailedtournament.js @@ -13,55 +13,74 @@ const typeDef = gql` ): Boolean! } - # all team datas here to display results? -> ask lean for Tournament format -> maybe top 3? - input DetailedTournamentInput { name: String! - bracket: String! + bracket_url: String! date: String! - winning_team_name: String! - winning_team_discord_ids: [String] + top_3_team_names: [[String]!]! + top_3_discord_ids: [[String]!]! } - input DetailedRoundInput { + input DetailedSetInput { round_number: Int! game_number: Int! stage: String! mode: Mode! - winners: TeamRoundInfo! - losers: TeamRoundInfo! + duration: Int! + winners: TeamInfo! + losers: TeamInfo! } - type DetailedTournament {} + type DetailedTournament { + name: String! + bracket_url: String! + date: String! + top_3_team_names: [[String]!]! + top_3_discord_ids: [[String]!]! + } - type DetailedRound { + type DetailedSet { tournament_id: DetailedTournament! round_number: Int! game_number: Int! stage: String! mode: Mode! - winners: TeamRoundInfo! - losers: TeamRoundInfo! - } - - # DC BOOl? name needed? - type TeamRoundInfo { - team_name: String! - names: [String!]! - discord_ids: [String!]! - weapons: [String!]! - main_abilities: [[Ability]!]! - sub_abilities: [[Ability]!]! - kills: [[Int]!]! - deaths: [[Int]!]! - specials: [[Int]!]! - paint: [[Int]!]! - gear: [[String]!]! "Duration of the round in seconds" duration: Int! + winners: TeamInfo! + losers: TeamInfo! + } + + type TeamInfo { + team_name: String! + players: [DetailedPlayer!]! "Score between 0 and 100 (KO)" score: Int! } + + type DetailedPlayer { + discord_id: String! + weapon: String! + main_abilities: [Ability]! + sub_abilities: [Ability]! + kills: Int! + assists: Int! + deaths: Int! + specials: Int! + paint: Int! + gear: [String]! + } + + type DraftLeaderboard { + players: [DraftPlayer!]! + } + + type DraftPlayer { + discord_id: String! + first: Int! + second: Int! + third: Int! + } ` const resolvers = {