const users = await prisma.user.findMany({}) const userIds = users.map((x) => x.id) const posts = await prisma.post.findMany({ where: { authorId: { in: userIds, }, }, })