v1.1.1
generator
Add aggregate
to the auto-generated CRUD system.
plugins
PrismaSelect
Support new return type AggregateX
X your model name
convert
{
aggregateUser{
count
min{
id
}
max{
id
}
avg{
id
}
sum {
id
}
}
}
To be
const select = {
count: true,
min: { id: true },
max: { id: true },
avg: { id: true },
sum: { id: true }
}
And you can pass it to your API like that
resolve(_parent, _args, { prisma, select }) {
return prisma.user.aggregate(select)
},
nexus
nexus plugin now adding AggregateX
types to your nexus schema so you can use them