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

Typesafe GraphQL client #627

Open
2 tasks done
JoeKarow opened this issue Aug 30, 2022 · 1 comment
Open
2 tasks done

Typesafe GraphQL client #627

JoeKarow opened this issue Aug 30, 2022 · 1 comment
Assignees
Labels

Comments

@JoeKarow
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Issue Context

There's been chatter on Typescript Tuesdays about how there's a way to have a typesafe GraphQL client...

Proposed solution

The current library we're using suggests a possible solution using this GraphQL codegen and this plugin.

Alternatives Considered

No response

Additional Resources

@tkshill @Narigo - Does this look like it could work?

Code of Conduct

  • I've read the Code of Conduct and understand my responsibilities as a member of the Virtual Coffee community
@JoeKarow JoeKarow added Status: Needs Triage This issue hasn't been reviewed by maintainers yet. Type: enhancement New feature or request labels Aug 30, 2022
@Narigo
Copy link
Sponsor Contributor

Narigo commented Aug 31, 2022

There are multiple ways how to generate TypeScript types from a GraphQL introspection query. I've used a module called graphql-codegen in the past, which seems to be deprecated / going to be archived and they also advise you to use the proposed solution. So I guess, it's the way to go! 👍

Keep in mind that the introspection query is used by these generators usually and the introspection usually shouldn't be made available for production systems. Maybe @danieltott can advise on how this should be done then. I guess you could export introspection query results manually and then use that static version of the introspection to generate code through the codegen script.

@danieltott danieltott added Tech: Typescript and removed Status: Needs Triage This issue hasn't been reviewed by maintainers yet. labels Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants