Graphql search relationship with aggregate

I have a product catalog with products assigned to various categories and sub categories. I would like to create a paged response with products searched within a category (including sub categories) and also get the count. Right now only way to search a product across categories relationship is possible only via @cascade anotation, which doesn’t work with aggregation.

For the count you need to use @custom DQL.