Tony Vi
06/17/2021, 8:39 PMprisma-client (v2.23.0) call. Here I'm trying to sort included issues. But nothing happens. Any kind of sort doesn't have effect.
@Query(() => Queue, { nullable: true })
async queueByKey(@Arg('key', () => String) key: string, @Ctx() ctx: Context) {
return ctx.prisma.queue.findUnique({
where: { key },
include: {
issues: {
orderBy: {
createdAt: 'desc',
},
},
},
});
}
Thanks for the any suggestion! 🙏Ryan
06/18/2021, 4:53 AMqueue has issues and the issues will be ordered by the createdAt field. This will have no effect on the queue data, just the data in the relation.Tony Vi
06/18/2021, 8:01 AMSo eachExactly what I want!) But it doesn't workhasqueueand theissueswill be ordered by theissuesfield.createdAt
Ryan
06/18/2021, 8:02 AMTony Vi
06/18/2021, 8:04 AMRyan
06/18/2021, 10:09 AM@prisma/client and prisma and also check if the logs you’re getting are correct or not.Tony Vi
06/18/2021, 10:12 AMRyan
06/18/2021, 10:25 AMTony Vi
06/18/2021, 10:26 AM