You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ A typed GraphQL client library for Rust.
14
14
- Subscriptions support (serialization-deserialization only at the moment)
15
15
- Copies documentation from the GraphQL schema to the generated Rust code
16
16
- Arbitrary derives on the generated responses
17
+
- Arbitrary custom scalars
18
+
- Supports multiple operations per query document
17
19
18
20
## Getting started
19
21
@@ -90,6 +92,16 @@ The generated response types always derive `serde::Deserialize` but you may want
90
92
structSearchQuery;
91
93
```
92
94
95
+
## Custom scalars
96
+
97
+
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.
98
+
99
+
## Query documents with multiple operations
100
+
101
+
You can write multiple operations in one query document (one `.graphql` file). You can then select one by naming the struct you `#[derive(GraphQLQuery)]` on with the same name as one of the operations. This is neat, as it allows sharing fragments between operations.
102
+
103
+
There is an example [in the tests](./tests/operation_selection).
0 commit comments