Hi there! Is there any way how to apply a custom r...
# exposed
l
Hi there! Is there any way how to apply a custom rules (query) for fetching relations?
Copy code
return Entity.wrapRows(query)
                .with(Entity::followers) <-- these relations are fetched correctly, based on the filtering applied to the main query (SELECT * FROM followers WHERE followers.id IN (...))
                .with(Entity::following) <-- need some additional filtering here (SELECT * FROM followers WHERE followers.id IN (...) AND followers.team_id != :teamId)
                .with(Entity::periodData)
                .map { it.toDomain() }
                .toList()