Fix ID bug
This commit is contained in:
parent
99217eedb6
commit
17c139f694
4 changed files with 88 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ cynic = { version = "3.2", features = ["http-surf"] }
|
|||
surf = "2"
|
||||
dirs = "5.0"
|
||||
futures = "0.3"
|
||||
serde = "1.0"
|
||||
|
||||
[build-dependencies]
|
||||
cynic-codegen = "3.2"
|
||||
|
|
|
|||
|
|
@ -1,2 +1,10 @@
|
|||
|
||||
pub mod search_games;
|
||||
|
||||
use schema::schema;
|
||||
|
||||
/// HACK: Unfortunately, start.gg seems to use integers for its ID type, whereas
|
||||
/// cynic always assumes that IDs are strings. To get around that, we define a
|
||||
/// new scalar type that serializes to u64.
|
||||
#[derive(cynic::Scalar, Debug)]
|
||||
pub struct ID(u64);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
use schema::schema;
|
||||
use super::ID;
|
||||
|
||||
// VARIABLES
|
||||
|
||||
|
|
@ -24,6 +25,6 @@ pub struct VideogameConnection {
|
|||
|
||||
#[derive(cynic::QueryFragment, Debug)]
|
||||
pub struct Videogame {
|
||||
pub id: Option<cynic::Id>
|
||||
pub id: Option<ID>,
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue