It looks like groupBy sort of does this, but it is not available in graphQL and only DQL. This basically means you need to do a @custom dql query. The problem is that you can’t use @auth on a custom query, so that only leaves putting a custom DQL within a custom mutation @lambda.