Prisma Auto Generate GraphQL Inputs with Validation from class-validator | NestJS Tutorial

preview_player
Показать описание
From my first impressions video with Prisma (link below) I called out an issue with the generated DTO type definitions, specifically around the topic of it having gaps with runtime model validation. I talk about that a bit more in this video and also discuss a potential solution that I discovered specifically for GraphQL APIs in NestJS

Рекомендации по теме
Комментарии
Автор

thanks for the shoutout! <3 Great Videos and super channel :D Love to see more!

OetziOfficial
Автор

Thank you! I've been looking for a solution to this for a couple days. This will definitely improve my workflow.

maxmonciardini
Автор

Amazing! I guess you must be thinking of using Prisma in your next project 😁

musbell
Автор

Hi Marius, this generator is very cool. I was getting very tired of having to update my model every time I would update my schema. The generator also adds the shema's /// comments to document your graphql. The only thing I recommend is rm the whole @generated folder every time your schema changes because it doesnt do a good job at cleaning up old files.

TheWalrus_
Автор

Your video saves me daily on work as I am doing project in Nest. Appreciate your hard work and teaching skills♥️

webdecodedwithfahad
Автор

the generated class look similar to DTO class, why it is not working for REST ?

rainedJMTi
Автор

Marius your videos are amazing. I would like more tutorials that will help you understand the generated types. I have a few questions:
1. That is, this package generates types such as prisma. Then you can somehow make the same auto-substitution as "Prisma.something"?. I work with NX for several applications, so I have to create a library with a module and export each type by hand in order to import it into the service. So far I can't figure out how to do it easier.

2. What is the correct way to think about these types when using them? I understand that this is a big question, but maybe you can answer, because there is little information about this on the Internet.

For example, "if I need a query - find a product variant by product id.
The getProductVariant service argument should be a type, where is the unique product id? That is, VariantWhereUnicInput? "

You will probably help many if you write in the comment how to think in order to decide which type to use? 🙏

alexpashkin
Автор

How can I use those generated DTO's to connect or create from graphql???

manuel
Автор

What's your take on using nexus and prisma instead of typegraphql and typeorm in nestjs?

xoldyckk
Автор

Could you please make a video about ABAC in nestjs with casl and prisma?

neonsegaming
Автор

Can you do NestJs + Prisma + GraphQL video please?

zawriter
join shbcf.ru