You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
graphql use string type to represent big integers but the rusts bigint's types deserialise expecting a tuple (sign, value) so I'm having issues to deal with big integers.
use num_bigint::BigInt;use serde::Deserialize;#[derive(Debug,Deserialize)]structData{num:BigInt,}fnmain(){let data = r#" { "num": "111111111111111111111111111111111111", } "#;let d:Data = serde_json::from_str(data).unwrap();println!("{}", d.num);}
thread 'main' panicked at src/main.rs:16:46:
called `Result::unwrap()` on an `Err` value: Error("invalid type: string \"111111111111111111111111111111111111\", expected a tuple of size 2", line: 3, column: 57)
code example to explain the problem, but the real-case error message is:
Hi,
graphql use string type to represent big integers but the rusts bigint's types deserialise expecting a tuple
(sign, value)
so I'm having issues to deal with big integers.code example to explain the problem, but the real-case error message is:
Error: reqwest::Error { kind: Decode, source: Error("invalid type: string \"29686942926033387970\", expected a tuple of size 2", line: 1, column: 177) }
what is the best way to bypass these issues ?
The text was updated successfully, but these errors were encountered: