prisma-relay-cursor-connection
prisma-relay-cursor-connection copied to clipboard
Empty return
I was trying to query all records but it was returning an empty object
findPage() {
return findManyCursorConnection(
(args) =>
this.prisma.product.findMany({ ...args, where: { published: true } }),
() => this.prisma.product.count(),
{},
);
}
That was the SQL request automatically generated by Prisma client
prisma:query
SELECT `main`.`Product`.`id`, `main`.`Product`.`createdAt`, `main`.`Product`.`updatedAt`, `main`.`Product`.`name`, `main`.`Product`.`description`, `main`.`Product`.`price`, `main`.`Product`.`sku`, `main`.`Product`.`published` FROM `main`.`Product` WHERE `main`.`Product`.`id` = ? LIMIT ? OFFSET ?
That's really weird, could you log out what args
looks like?
return findManyCursorConnection(
(args) => {
console.log(args);
return this.prisma.product.findMany({ ...args, where: { published: true } });
},
() => this.prisma.product.count(),
{}
);
Going to close this due to the conversation stopping