Open MichalLytek opened 5 years ago
We now have a GraphQL Code Generator plugin for emitting TypeGraphQL type classes from SDL schema 🎉
https://graphql-code-generator.com/docs/plugins/typescript-type-graphql
It might be used by the SDL converter tool on the website.
Hi, @MichalLytek Thank you so much for the great library and plugin.
It's just a question but typescript-type-graphql plugin of graphql-code-generator could generate type classes for me, but couldn't generate resolver classes. Can I do that any way?
I tried typescript-resolver
plugin but it didn't add the @Resolver
annotation so I won't use for type-graphql.
@a-suenami Ask on graphql-code-generator repository for assist with that, I'm not the author of the plugin.
I agree that it would be nice to generate resolvers classes with args that would just throw "not implemented" error in body.
The graphql-codegen output looks a little messy
Based on the conversation on the schema first approach (#222), it would be nice to have a website (or as a part of TypeGraphQL CLI - #66) that would convert the schema definition to TypeGraphQL type classes and empty resolvers (without method implementation).
Of course it would be hard to detect common things like
Connection
orEdge
generics so the generator would produce not optimal TypeGraphQL code but it would be still better than rewriting the types by hand.*Side note: Inspired by Nexus.js SDL converter: https://nexus.js.org/converter