Hey, when doing including a model with prisma, is ...
# orm-help
a
Hey, when doing including a model with prisma, is there a way to limit the number of records returned? For eg, I want to include posts when fetching a user, but I only want to get the first 3 posts?
r
Yes you can use
take
inside
include
.
a
perfect, thanks 🙂
💯 1
Copy code
ctx.prisma.quotes.findUnique({
          where: { id: args.quote_id },
          include: {
            suppliers: {
              include: { reviews: true, take: 1 },
            },
          },
        });
trying to do this, can't quite figure out where I'm going wrong with the syntax
r
include: { reviews: { take: 1 } }