ezeikel
03/26/2019, 11:31 AMfeed: async (_, { id }, ctx, info) => {
const following = await ctx.prisma.user({ id }, info).following();
const followingIds = following.map(follower => follower.id);
return ctx.prisma.posts(
{
where: {
author: { id_in: [...followingIds, ctx.request.userId] }
},
orderBy: "createdAt_ASC",
},
info
);
},
Samuel Okoroafor
03/26/2019, 11:41 AMezeikel
03/26/2019, 11:49 AMezeikel
03/26/2019, 11:50 AMwhere
and just have the orderBy
it works as expected when switching between createdAt_ASC
and createdAt_DESC
ezeikel
03/26/2019, 11:50 AMSamuel Okoroafor
03/26/2019, 11:57 AMSamuel Okoroafor
03/26/2019, 12:00 PMezeikel
03/26/2019, 12:04 PM"prisma-client-lib": "1.28.3"
ezeikel
03/26/2019, 12:04 PM