From 044d28cfe902b1bdc4746015e8ba025095198d2e Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 1 Nov 2024 21:49:31 +0300 Subject: [PATCH] psql --- resolvers/reader.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resolvers/reader.py b/resolvers/reader.py index d8fb9a81..67b43fbb 100644 --- a/resolvers/reader.py +++ b/resolvers/reader.py @@ -164,7 +164,16 @@ def query_with_stat(info): # Фильтр опубликованных q = q.where(and_(Shout.published_at.is_not(None), Shout.deleted_at.is_(None))) - q = q.group_by(Shout.id, main_author, stats_subquery) + q = q.group_by( + Shout.id, + main_author.id, + main_author.name, + main_author.slug, + main_author.pic, + stats_subquery.c.comments_count, + stats_subquery.c.rating, + stats_subquery.c.last_reacted_at + ) return q