Matheus Assis
08/21/2020, 6:11 PMctx*.*_prisma_*.*_user_*.*findOne({ where: { id: root*.*_id_ } })*.*_contacts.count(args)_
as contacts.count
doesn't exist in that situation
-----
Edit: I used ctx.prisma.contact.count({ where: { user: { some: { id: root*.*_id_ } } } })
But idk if it's the correct/most optimized way of doing itRichard Ward
08/23/2020, 5:55 PMuser.findOne().contacts
will generate 2 queries where the contact.count
may only produce one (an, like you said, the first option doesn't exist).Richard Ward
08/23/2020, 5:55 PMconst prisma = new PrismaClient({
log: ['query']
});