Is there a query parameter to get categories that are related to anything else? I'm looking for a way to query all categories that have at least one relation.  I'm not looking for the relatedTo() parameter, which would give me categories related to something specific.

Basically, if we talk in Wordpress terms, I'm looking for hideEmpty = true.

Is there anything like that in Craft?

Something like: craft.categories.group('products').hasRelated()
Add this to your chain...

.yourCategoryField(':notempty:')


It's not very well documented, but you can see it described in this old SE thread. In the docs, it's mentioned very briefly here.