In a WHOLE SEA of 3 hour tutorials on this stuff, you've struck genius here. You explained no more, and no less than absolutely necessary for me to follow along, while actually understanding the 'why' behind it all. As someone brand new to nest, graphql, and prisma all at once, I'm just astonished and grateful. One of the best programming related walkthroughs / tutorials I have seen in a very, very long time. Thank you so much for making this
It is a basic tutorial, however it is an excellent tutorial for a newbie to Prisma, Postgres and GraohQL. Congratulations and greetings from Santiago de Chile.
codingIsLove, my heartburn with this solution is that you get the worst of both worlds. You do a "code first" AND a schema implementation, due to Prisma. Not only does this require you to do double the work and make sure both systems are in sync, it appears to make the Entity concept almost useless. Ideally my Entity would construct my schema so that I don't have to manage this in two places, like .Net's code first Entity framework. Any thoughts? I am new to NestJS and GraphQL, so I may be missing something. Is there a better ORM that ties in more seamlessly with Apollo? Also, I wrote an OData layer for Primsa and found Prisma lacking the ability to many things that would also affect GraphQL. Am I correct to assume that Apollo gets around that by using raw SQL queries and in this Next/Apollo/Prisma example, Prisma is only used really to manage database migrations? Any recommendations on how to do a true code-first implementation with Nest and Graph would be appreciated.
Maybe too late, but TypeORM lets you do the true code-first approach. You just add some more Entity/Relation decorators into the already existing entities. You also have to import one module (i think) and inject repositories into their respective services. I would say that this approach showcased by codingIsLove is good for understanding the basics, but I also prefer the true code-first approach.