Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a rust struct for a GraphQL type? #443

Open
antholeole opened this issue Jan 3, 2023 · 3 comments
Open

Generate a rust struct for a GraphQL type? #443

antholeole opened this issue Jan 3, 2023 · 3 comments

Comments

@antholeole
Copy link

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
Copy link

banool commented Jul 31, 2023

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
Copy link
Author

I did not, sorry. Best of luck.

@banool
Copy link

banool commented Jul 31, 2023

For anyone else who comes along, I got pretty far by forking this repo instead: https://github.com/banool/async-graphql-reverse/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants