We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent faa2d44 commit d646d4fCopy full SHA for d646d4f
src/content/code/language-support/rust/client/gql_client.md
@@ -0,0 +1,32 @@
1
+---
2
+name: gql_client
3
+description: Minimal GraphQL client for Rust
4
+url: https://github.com/arthurkhlghatyan/gql-client-rs
5
+github: arthurkhlghatyan/gql-client-rs
6
7
+
8
+Usage example
9
+```rust
10
+use gql_client::Client;
11
12
+#[tokio::main]
13
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
14
+ let endpoint = "https://graphqlzero.almansi.me/api";
15
+ let query = r#"
16
+ query AllPostsQuery {
17
+ posts {
18
+ data {
19
+ id
20
+ }
21
22
23
+ "#;
24
25
+ let client = Client::new(endpoint);
26
+ let data: AllPosts = client.query::<AllPosts>(query).await.unwrap();
27
28
+ println!("{:?}" data);
29
30
+ Ok(())
31
+}
32
+```
0 commit comments