Type-graphql: SDL converter

Created on 7 Feb 2019  路  4Comments  路  Source: MichalLytek/type-graphql

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 or Edge 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

Enhancement Help Wanted

Most helpful comment

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.

All 4 comments

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

Bez聽tytu艂u

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itsgracian picture itsgracian  路  3Comments

MichalLytek picture MichalLytek  路  3Comments

robertchung97 picture robertchung97  路  3Comments

reilem picture reilem  路  3Comments

glentakahashi picture glentakahashi  路  3Comments