A typed GraphQL client library for Rust that generates precise types for queries and responses at compile time.
graphql_client is a Rust library that provides type-safe GraphQL client capabilities by generating Rust types from GraphQL schemas and queries at compile time. It solves the problem of mismatched data shapes between GraphQL APIs and Rust code by ensuring that all queries and responses are precisely typed, reducing runtime errors.
Rust developers building applications that consume GraphQL APIs, especially those who prioritize type safety and want to integrate GraphQL seamlessly into their Rust projects.
Developers choose graphql_client because it offers full type safety for GraphQL operations in Rust, catching errors at compile time rather than runtime, and it integrates smoothly with existing Rust tooling and workflows.
Typed, correct GraphQL requests and responses in Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates precise Rust types from GraphQL schemas at compile time using procedural macros, catching data mismatches early and eliminating runtime errors, as demonstrated in the derive usage with schema_path and query_path.
Designed to work in the browser for client-side GraphQL operations, making it suitable for WebAssembly-based frontends, explicitly listed in the features section of the README.
Handles advanced GraphQL features like fragments, unions, custom scalars, and input objects, providing comprehensive coverage for complex schemas, evidenced by the detailed feature list.
Copies documentation from the GraphQL schema into the generated Rust code, improving code readability and maintainability, a feature highlighted in the README.
Requires managing separate schema and query files, procedural macro configuration, and potentially a CLI tool for schema introspection, adding complexity compared to runtime-only clients.
Subscriptions support relies on external libraries like graphql-ws-client for runtime handling, introducing an extra dependency and setup step, as admitted in the README.
Queries must be predefined in .graphql files and compiled in, preventing dynamic query generation at runtime, which restricts flexibility for applications needing adaptive queries.