There is a products model that hasOne brand and hasMany attributes. I am trying to sort products by brand.name. {{apiUrl}}/product?$eager=[brand, attributes]&$joinRelation=[brand]&$sort[brand.name]=-1
This however resulted in SELECT DISTINCT, ORDER BY expressions must appear in select list
So I tried {{apiUrl}}/product?$joinEager=[brand, attributes]&$sort[brand.name]=-1
which works, but due to needing pagination the limit is applied to the hasMany relations.
How can I sort products by brand name while also including hasMany relations?