Michael B
09/29/2021, 11:38 AMmodel User {
email String?
}
and requesting users in the client
const users = await prisma.users.findMany({
where: {
NOT: {
email: {
equals: null,
},
},
},
})
Is it possible to get a returned type of?
{ email: string }[]
The current return type I am getting is
{ email: string | null }[]
Ryan
09/29/2021, 11:40 AMRyan
09/29/2021, 11:46 AMimport { User } from '@prisma/client'
const users = (await prisma.users.findMany({
where: {
NOT: {
email: {
equals: null,
},
},
},
})) as UsersWithEmail[]
type UsersWithEmail = User & { email: string }
Michael B
09/29/2021, 11:50 AM