Allow filtering relations by a query