matic
02/13/2018, 10:00 PMinfo
parameter as the second argument of .query
count: {
fragment: `fragment LikesCount on Post { id }`,
resolve: async ({ id }, args, ctx: Context, info) => {
const likes = await ctx.db.query.likesConnection(
{ where: { post: { id } } },
` { aggregate { count } } `,
)
return likes.aggregate.count
}
},