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

SDL converter #251

Open
MichalLytek opened this issue Feb 7, 2019 · 4 comments
Open

SDL converter #251

MichalLytek opened this issue Feb 7, 2019 · 4 comments
Labels
Enhancement 🆕 New feature or request Help Wanted 🆘 Extra attention is needed

Comments

@MichalLytek
Copy link
Owner

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

@MichalLytek MichalLytek added the Enhancement 🆕 New feature or request label Feb 7, 2019
@MichalLytek MichalLytek added this to the Future release milestone Feb 7, 2019
@MichalLytek
Copy link
Owner Author

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.

@MichalLytek MichalLytek added the Help Wanted 🆘 Extra attention is needed label Aug 24, 2019
@a-suenami
Copy link

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.

@MichalLytek
Copy link
Owner Author

@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.

@michal239
Copy link
Contributor

The graphql-codegen output looks a little messy

Bez tytułu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 🆕 New feature or request Help Wanted 🆘 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants