|0.2.1||Apr 8, 2021|
|0.2.0||Apr 7, 2021|
|0.1.1||Apr 7, 2021|
|0.1.0||Apr 5, 2021|
Used in gurkle-cli
GraphQL client for Rust, with typed requests and responses, and subscriptions!
- Precise types for query variables and responses.
- Supports GraphQL fragments, objects, unions, inputs, enums, custom scalars and input objects.
- Works in the browser (WebAssembly).
- Subscriptions support (serialization-deserialization only at the moment).
- Copies documentation from the GraphQL schema to the generated Rust code.
- Arbitrary derives on the generated responses.
- Arbitrary custom scalars.
- Supports multiple operations per query document.
- Supports setting GraphQL fields as deprecated and having the Rust compiler check their use.
- Install the CLI tool.
gurkle generate --schema-path <your schema> path/to/operations/*.graphql
- This will generate a
mod.rsin your current directory.
The generated code will reference the scalar types as defined in the server schema. This means you have to provide matching rust types in the scope of the struct under derive. It can be as simple as declarations like
type Email = String;. This gives you complete freedom on how to treat custom scalars, as long as they can be deserialized.
The generated code has support for
You can use
cargo doc --document-private-items to generate rustdoc documentation on the generated code.
See the examples directory in this repository.
Anyone who interacts with this project in any space, including but not limited to this GitHub repository, must follow our Code of Conduct.
Licensed under either of these:
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in the work, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.