From ec08e85e8f01148e2c6446827035654d21cc4c58 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 23 Feb 2024 10:14:58 +0300 Subject: [PATCH] select-from-fix --- resolvers/follower.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resolvers/follower.py b/resolvers/follower.py index 7b116d5b..8db05c3a 100644 --- a/resolvers/follower.py +++ b/resolvers/follower.py @@ -105,6 +105,7 @@ def query_follows(user_id: str): func.count(func.distinct(AuthorFollower.author)).label("authors_stat"), func.count(func.distinct(AuthorFollower.follower)).label("followers_stat") ) + .select_from(aliased_author) .filter(AuthorFollower.author == aliased_author.id) .join(AuthorFollower, AuthorFollower.follower == aliased_author.id) .outerjoin(ShoutAuthor, ShoutAuthor.author == author_id) @@ -124,6 +125,7 @@ def query_follows(user_id: str): func.count(func.distinct(ShoutAuthor.author)).label("authors_stat"), func.count(func.distinct(TopicFollower.follower)).label("followers_stat") ) + .select_from(aliased_topic) .join(TopicFollower, TopicFollower.topic == aliased_topic.id) .outerjoin(ShoutTopic, aliased_topic.id == ShoutTopic.topic) .outerjoin(aliased_shout_authors, ShoutTopic.shout == aliased_shout_authors.shout)