fivewen
PPrisma
•Created by fivewen on 5/26/2024 in #help-and-questions
How to create Prisma Client's generated types with nested models?
Hi guys,
I am currently trying to define generate model types using Prisma.validator to include relations.
I've followed this documentation: https://www.prisma.io/docs/orm/prisma-client/type-safety/operating-against-partial-structures-of-model-types#problem-using-variations-of-the-generated-model-type
However, I am confused how I can set up with model with nested models.
For example, I have a Post that has UserSocial Model. In addition, UserSocial has 1 to 1 relationship with User model.
I want to generate a PostWithUserSocial but also has the nested User model included.
Does anyone know how I can achieve this?
5 replies