Giorgio Delgado
10/05/2020, 10:26 PMcomment --> post --> site
Aaron Fulkerson
10/06/2020, 1:52 AMawait prisma.post.findMany({ where: { siteId: siteId }, include: { comments: true } })
Aaron Fulkerson
10/06/2020, 1:52 AMAaron Fulkerson
10/06/2020, 2:14 AMawait prisma.comment.findMany({ where: { post: { siteId: siteId } } })
nikolasburk
const commentsBySite = await prisma.comment.findMany({
where: {
post: {
site_id: 'ckfxix6rw00035lzkgilqgjtm',
},
},
})
Giorgio Delgado
10/06/2020, 1:13 PMGiorgio Delgado
10/06/2020, 2:20 PMoutput
field in my generator
directive, and I was importing PrismaClient
from the wrong location initially!