How can I generate automatic typescript types, with Hasura and graphql-codegen [Question]
See original GitHub issueI was following Hasura automatic type generation for React/Angular Apps. It seems that code-gen
takes all the query and mutation and introspection and then it generates typescript type defs.
https://hasura.io/learn/graphql/typescript-react-apollo/codegen/
In refine since I don’t have to write query and mutation, how can I generate typescript type definition file. As of now I am writing all possible query and mutation.
I am using create react app and refine as npm deps
Issue Analytics
- State:
- Created a year ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Your Guide to GraphQL with TypeScript - Hasura
Tutorial · Step One: Clone and configure the code repository · Step Two: Run Hasura Console · Step Three: Generate the typings ·...
Read more >GraphQL code generator with Typescript, Angular ... - YouTube
In previous videos we build a small Angular App which uses Hasura GraphQL engine as a backend. And everything is great and works...
Read more >Support for generating types from Hasura · Issue #344 - GitHub
I used to do this automatically with https://graphql-code-generator.com/. It can even generate ready to use React hooks for you (Apollo or Urql) ...
Read more >Generate GraphQL Types with Apollo Codegen Tutorial
Generate TypeScript types for queries written in an Apollo Client project (given a valid GraphQL schema). And that's exactly what we'll do.
Read more >typescript - GraphQL Code Generator
This plugin generates the base TypeScript types, based on your GraphQL schema. The types generated by this plugin are simple, and refers to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@omeraplak yes definitely. Let me first try how to generate all possible queries and mutation Thanks
Hey @nirmaanlabs, Unlike GraphQL clients, Refine does not use introspection. Our approach is to generate a query. We think this approach is much more manageable, but not being able to auto-generate TypeScript types is a big miss…
Data providers are responsible for creating the queries. for example, https://github.com/pankod/refine/blob/master/packages/graphql/src/index.ts#L63