graphql-client
graphql-client copied to clipboard
unresolved import `serde` use of undeclared crate or module `serde`
When following example code, I get the following error:
unresolved import `serde`
use of undeclared crate or module `serde`
Is serde in your Cargo.toml?
It should mention in the README what crates and features are necessary to run the examples. Another e.g.: It's not straightforward to people new to the ecosystem that "json" is a feature that must be enabled for reqwest. You have to dig into the Github example to see that.
reqwest = { version = "^0.11", features = ["json", "blocking"] }
Is it a bug that to use graphql_client I also have to have serde explicitly included in my crate's dependencies? I see serde named in graphql_client's own dependencies, so it's somewhat surprising I have to include it, too. (caveat: I'm very new to Rust and would be grateful for any teachings people are in the mood to give)
I've run into the same issue: glad the discussion is here and I'll add serde to my Cargo.toml, but it's also not clear to me why this is so. (I am also new to working with packages that make use of macros in this fashion)