{"repo":"graphql-rust/graphql-client","free":true,"listed":false,"github":"https://github.com/graphql-rust/graphql-client","clone":"git clone https://github.com/graphql-rust/graphql-client.git","description":"Typed, correct GraphQL requests and responses in Rust","language":"Rust","stars":1262,"topics":["graphql","rust","wasm","webassembly","client"],"license":"Apache-2.0","category":"api-integrations-sdks","readme_excerpt":"graphql client A typed GraphQL client library for Rust. Features - 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. - 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. - Optional reqwest-based client for boilerplate-free API calls from browsers. - Implicit and explicit null support. Getting started - If you are not familiar with GraphQL, the official website provides a very good and comprehensive introduction. - Once you have written your query (most likely in something like graphiql), save it in a .graphql file in your project. - In order to provide precise types for a response, graphql client needs to read the query and the schema at compile-time. To download the schema, you have multiple options. This projects provides a CLI, however it does not matter what tool you use, the resulting schema.json is the same. - We now have everything we need to derive Rust types for our query. This is achieved through a procedural macro, as in the following snippet: The derive will generate a module named union query in this example - the name is the struct's name, but in snake case. That modul","default_branch":null,"files":null,"tree":[],"storefront":"/r/graphql-rust","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/graphql-rust/graphql-client/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}