How can we order by the numbers of Childs? (GraphQl)


#1

How can we order by the numbers of Childs (or nested)?

Examples: Let’s assume we have 2 objects: Post and Comment. 1 Post has many comments.

What is the query to get All posts order by the number of comments?

Related: https://stackoverflow.com/questions/56552911/prisma-how-can-we-order-by-the-numbers-of-childs-graphql


#2

This is not possible with prisma (yet?, Prisma 2). There is an issue on github, link.


#3

ok thanks!
I guess a manual query in the resolver should work… :confused: