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: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
11
11
12
12
- (breaking) Control over which types custom scalars deserialize to is given to the user: you now have to provide type aliases for the custom scalars in the scope of the struct under derive.
13
13
- (breaking) Support for multi-operations documents. You can select a particular operation by naming the struct under derive after it. In case there is no match, we revert to the current behaviour: select the first operation.
14
+
- Support arbitrary derives on the generated response types via the `response_derives` option on the `graphql` attribute.
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ A typed GraphQL client library for Rust.
13
13
- Works in the browser (WebAssembly)
14
14
- Subscriptions support (serialization-deserialization only at the moment)
15
15
- Copies documentation from the GraphQL schema to the generated Rust code
16
+
- Arbitrary derives on the generated responses
16
17
17
18
## Getting started
18
19
@@ -74,6 +75,21 @@ A typed GraphQL client library for Rust.
74
75
75
76
[A complete example using the GitHub GraphQL API is available](https://github.com/tomhoule/graphql-client/tree/master/examples/github), as well as sample [rustdoc output](https://www.tomhoule.com/docs/example_module/).
76
77
78
+
## Deriving specific traits on the response
79
+
80
+
The generated response types always derive `serde::Deserialize` but you may want to print them (`Debug`), compare them (`PartialEq`) or derive any other trait on it. You can achieve this with the `response_derives` option of the `graphql` attribute. Example:
0 commit comments