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

Add the option to generate schema types from TS classes #108

Closed
vnenkpet opened this issue Jan 16, 2019 · 3 comments
Closed

Add the option to generate schema types from TS classes #108

vnenkpet opened this issue Jan 16, 2019 · 3 comments

Comments

@vnenkpet
Copy link

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

What is the motivation / use case for changing the behavior?

The current implementation forces us to have a GraphQL types defined in a .graphql file. I suggest taking inspiration from the https://19majkel94.github.io/type-graphql/ library and add the option to completely throw away any external schema input and allow us to generate the schema from the classes with decorators (https://19majkel94.github.io/type-graphql/docs/types-and-fields.html) similar to how Resolvers are already handled. A lot of the API of the type-graphql library seems compatible with nestjs/graphql already in principle. It just generally seems like a better fit for how Nest is structured the current solution IMO. I worked with type-graphql before and it works great, but it lacks the overall architecture of nestjs so it'd be nice if nestjs could incorporate some or all of its features.

Environment


Nest version: 5.5.0

 
For Tooling issues:
- Node version: irrelevant
- Platform: irrelevant

Others:

@kamilmysliwiec
Copy link
Member

See #85. I'm working on it already

@vnenkpet
Copy link
Author

vnenkpet commented Jan 16, 2019

Oh I'm an idiot. I opened that exact issue in a separate tab to check if it's not what I'm proposing and forgot to read it before writing this :) But great! Thanks.

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants