I'm in the process of transitioning from TypeORM to Prisma.
TypeORM
const user = await getUser("123", ["car", "car.wheels"])
static async getUser(
userId: string,
relations: string[]
) {
return await UserEntity.findOne(
{
where: {
id: userId
},
relations: relations
}
)
}
When using Prisma, the equivalent of relations
in TypeORM is handled with the include
function. How can I pass a variable relation into a Prisma function?