TypeScript codegen
See original GitHub issueWe could generate TS types for the GraphQL queries in the project in parallel of something like graphql-document-collector to get the query docs globally.
I’ll work on this in a folder parallel to the swift/
folder.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:16 (11 by maintainers)
Top Results From Across the Web
ferdikoomen/openapi-typescript-codegen
NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification - GitHub - ferdikoomen/openapi-typescript-codegen: NodeJS ...
Read more >graphql-codegen/typescript
GraphQL Code Generator plugin for generating TypeScript types. Latest version: 2.8.5, last published: 18 days ago.
Read more >typescript
@graphql-codegen/typescript, Downloads, Version, License ... This plugin generates the base TypeScript types, based on your GraphQL schema.
Read more >Is there code generation API for TypeScript?
When I needed to generate some C# code, for example DTO classes from xsd schema, or an excel table, I've used some roslyn...
Read more >TypeScript GraphQL Code Generator
In this post, you'll learn how to use Apollo's GraphQL codegen to generate TypeScript types for GraphQL operations in your Apollo Client ...
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 Free
Top Related Reddit Thread
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
Yep cool! Would love to see both of these tools actually. Writing typings for objects created from graphql is driving me crazy… 😃
@davidyaha exactly. Right now, my main focus is client-side developer experience. Client side is usually harder and more error prone than client side in my own experience. This is still very much true with GraphQL where creating the schema is relatively easy but building a large app with large queries and such can become incrementally complex.
In the latest example you gave, to me, NestedObj may not require every field the type allows it to contain (see my example). However, NestedObjFragment can be a thing. My point is: here we’re going to be query-based, because that would help with the client DX. However, and I’m glad you brought that up, gql2ts is an amazing tool for server side! Because on the server you can virtually think that everything your schema is providing is immediately available. By the way, I would love having a gql2ts-kind of project available for flow as well!
This is some great stuff discussed here, I don’t think there will be one unique build tool for all of this but a bunch of complementary ones! (in a truly JS-fatigue manner, we’ll figure out later how we’ll make that work for beginners, let’s just start by experimenting!)