Generate a rust struct for a GraphQL type?
antholeole opened this issue · 4 comments
antholeole commented
I have a type like so:
type AuthenticationOutput {
access_token: String!
admin: Boolean!
refresh_token: String!
}and I'd like to generate a Rust struct for it. The use case is that Hasura allows you to define web hooks, and defines the inputs / outputs of the web hooks as GraphQL types. Is there a way to generate the struct for this type? or does the type have to be attached to a query? Thanks!
banool commented
Did you have any luck with this? I'm just now going to look into the graphql_client_codegen crate and see what I can do.
antholeole commented
I did not, sorry. Best of luck.
banool commented
For anyone else who comes along, I got pretty far by forking this repo instead: https://github.com/banool/async-graphql-reverse/.