When i generate my prisma client with prisma generate, i got an index.d.ts with all types from my database. But the probleme is that all type are "single" and there is no relations. When i query something like
prisma.users.findMany({
[... ]
include: {
cars: {
[...]
}}});
prisma type the response dynamically with the right type
users & {
cars: cars & {
[...]
};
}
So everything work well and I have the auto completion, except if I want to pass this variable to another method, I would like to type the parameters, so I have to create my own type used as method parameter.
type prismaUsers = users & {
cars?: cars & {
[...]
};
}
But I'm asking if there is a way to get the "full" type from prisma to avoid me to create all "full" types with optionals sub-elements like I did for the user example. Or maybe i'm doing wrong and there is another way to do?