// the find
graphql-rust/graphql-client
Typed, correct GraphQL requests and responses in Rust
graphql-client generates typed Rust structs from your GraphQL schema and query files at compile time, giving you serde-ready request/response types without hand-rolling them. It's for Rust projects that talk to GraphQL APIs and want the compiler to catch shape mismatches before runtime. Works in native and WASM targets.
The compile-time codegen approach means type errors between your query and schema are caught at `cargo build`, not in production. Support for unions, interfaces, and fragments is real — not bolted on as an afterthought, as evidenced by the dedicated test files for each. The `@deprecated` field handling that can be set to `deny` is a nice touch that turns schema drift into a hard build error. WASM support is first-class and the web example is a working proof, not a theoretical footnote.
Custom scalars require manual type aliases in scope, which is fiddly and produces opaque build errors if you forget — the error message points at generated code, not your query file. Subscriptions are handled for codegen only; you're on your own for the runtime transport layer and have to pull in a separate crate. The project has had slow maintenance periods and the CHANGELOG shows long gaps, so you may be stuck waiting for GraphQL spec additions to be supported. Build times take a hit for any crate using proc macros heavily, and complex schemas with many operations will make this noticeable.