Davedavedave
05/30/2022, 12:20 PM// type for existing gets inferred like this:
// { id: string | null }[]
const existing = prisma.users.findMany({
select: { id: true },
where: { NOT: { id: null } }
})
I tried to use Prisma validators with a validator for select and a seperate for where or one for the FindManyArgs type, but this didnt seem to work properly.
How do I get the correct returnType of string ids in this case?
Thanks guys 🙂Nurul
05/30/2022, 12:55 PMDavedavedave
05/31/2022, 6:44 AMconst validated = Prisma.validator<Prisma.UserFindManyArgs>()({
select: {
id: true,
},
where: {
id: {
not: null,
},
},
});
const existing = prisma.users.findMany(validated)
Hey 👋
So this still returns the type mentionaed above with the null
and if i set them separately, it has the same resultDavedavedave
05/31/2022, 8:37 AMVladi Stevanovic