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 operations by generating Rust types from GraphQL schemas and queries at compile time. It ensures correctness and developer productivity by leveraging Rust's type system to catch errors before runtime, enabling seamless integration with GraphQL APIs.
Rust developers building applications that interact with GraphQL APIs, particularly those who prioritize compile-time safety and want to avoid runtime errors related to query and response structures.
Developers choose graphql_client for its compile-time type generation, which guarantees that GraphQL queries and responses match the schema precisely, reducing bugs and improving code reliability. Its support for WebAssembly, subscriptions, and customizable derives makes it a versatile choice for both server-side and browser-based Rust projects.
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 and queries at compile-time, catching mismatches and errors before runtime, as emphasized in the library's philosophy.
Works seamlessly in browser environments, enabling typed GraphQL clients for Rust-based web applications without extra configuration, a key feature highlighted in the README.
Supports complex GraphQL features like unions, custom scalars, fragments, and multiple operations per document, making it suitable for sophisticated APIs.
Allows arbitrary trait derivations on response types and configurable deprecation handling, providing ergonomic integration with existing Rust workflows.
Requires managing separate schema and query files, integrating with Cargo's build system, and dealing with issues like automatic recompilation when .graphql files change, as noted in the README.
All GraphQL operations must be defined statically at compile-time, making it impractical for applications that need to generate or modify queries on the fly.
For features like subscriptions, it depends on third-party libraries like graphql-ws-client, adding ecosystem complexity and potential integration hurdles.