From ce03cbcd2a7f05a47e93279863ad7745b8bd15e4 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Sat, 2 Sep 2023 01:41:44 -0400 Subject: [PATCH] Workaround bug in server side It took me SO LONG to figure out what the issue is... --- cli/src/main.rs | 2 +- cli/src/queries/tournament_sets.rs | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index b77d77e..c909501 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -36,7 +36,7 @@ fn main() { if let Some(response) = run_query::( TournamentSetsVars { - last_query: None, + last_query: Timestamp(1), game_id: VideogameId(1386), country: None, state: Some("GA"), diff --git a/cli/src/queries/tournament_sets.rs b/cli/src/queries/tournament_sets.rs index 614920d..05ca4e1 100644 --- a/cli/src/queries/tournament_sets.rs +++ b/cli/src/queries/tournament_sets.rs @@ -6,9 +6,12 @@ use schema::schema; #[derive(cynic::QueryVariables, Debug)] pub struct TournamentSetsVarsRaw<'a> { + // HACK: This should really be an optional variable, but there seems to be a + // server-side bug that completely breaks everything when this isn't passed. + last_query: Timestamp, + country: Option<&'a str>, game_id: ID, - last_query: Option, state: Option<&'a str>, } @@ -76,9 +79,9 @@ struct Entrant { // Unwrap pub struct TournamentSetsVars<'a> { - pub country: Option<&'a str>, + pub last_query: Timestamp, pub game_id: VideogameId, - pub last_query: Option, + pub country: Option<&'a str>, pub state: Option<&'a str>, } @@ -99,16 +102,16 @@ impl<'a> QueryUnwrap> for TournamentSets { fn wrap_vars( TournamentSetsVars { - country, - game_id: VideogameId(game_id), last_query, + game_id: VideogameId(game_id), + country, state, }: TournamentSetsVars, ) -> TournamentSetsVarsRaw { TournamentSetsVarsRaw { - country, - game_id: ID(game_id), last_query, + game_id: ID(game_id), + country, state, } }