Top 20 players per game

I have a query that return a count of game played per game. I now wish to sort and limit the result; so tha t i have the top 20 players per game.

Here is the query so far.

{
query (func: has(GameActivityReplica.game)) @groupBy([GameActivityReplica.replicatesPlayIn, GameActivityReplica.replicatesActivityOf]){
		gcount: count(uid)
  }
}

Any help on getting this ordered and limited to the top 20 will be appreciated.

Have you checked out the documentation for those two operations?

https://dgraph.io/docs/query-language/sorting/

https://dgraph.io/docs/query-language/pagination/

Many thanks. I have learned so much from that,