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

GraphQL Question #23

Closed
bobbypiper opened this issue Aug 24, 2021 · 2 comments
Closed

GraphQL Question #23

bobbypiper opened this issue Aug 24, 2021 · 2 comments

Comments

@bobbypiper
Copy link

Just thought I'd take a moment to thank you for this awesome repo. I regularly struggle for technical sources online suitable for enterprise level development; this is one of the best I've seen on this subject.

One question comes to mind, how would you organise GraphQL within this space? Originally l considered a singular graphql model isolated... but that seems inelegant having thought on it.

@Sairyss
Copy link
Owner

Sairyss commented Aug 25, 2021

Hi, thanks for kind words.

I'd probably do it nestjs way: https://docs.nestjs.com/graphql/resolvers#object-types
Or use this package: https://www.npmjs.com/package/type-graphql

Just add @Field() decorators to your DTOs, super simple.

If you don't like the solutions above, I'd define a graphql schema for each module separately and use some npm package to convert it to TypeScript types automatically, for example: https://github.com/dotansimha/graphql-code-generator

Hope this answers your question

@jcbertolucci
Copy link

Thanks for putting all this great content together @Sairyss. 🚀

@Sairyss Sairyss closed this as completed Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants