From ae861aa8b4db2e3e7c478bef447d50809e239490 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 6 Jun 2024 12:23:47 +0300 Subject: [PATCH] fix-select-by-topic --- resolvers/author.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resolvers/author.py b/resolvers/author.py index 39b98517..e5958e3f 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -113,7 +113,11 @@ async def load_authors_by(_, _info, by, limit, offset): authors_query = authors_query.filter(Author.name.ilike(f"%{by['name']}%")) elif by.get("topic"): authors_query = ( - authors_query.join(ShoutAuthor).join(ShoutTopic).join(Topic).where(Topic.slug == str(by["topic"])) + authors_query + .join(ShoutAuthor) + .join(ShoutTopic, ShoutAuthor.topic_id == ShoutTopic.id) + .join(Topic, ShoutTopic.topic_id == Topic.id) + .filter(Topic.slug == str(by["topic"])) ) if by.get("last_seen"): # in unix time