prisma-selections
v0.0.4
Published
Prisma selections allow you to define "select aliases", so instead of writing:
Downloads
17
Readme
Prisma Selections
Prisma selections allow you to define "select aliases", so instead of writing:
const user = await prisma.user.findUnique({
select: {
id: true,
fullName: true,
username: true,
avatarUrl: true,
// ...
}
})
You can write this instead:
const user = await prisma.user.findUnique({
select: selections.user({
$profileData: true,
// ...
})
})
And fully leverage the powerful intellisense provided by Prisma's TypeScript types!