diff --git a/resolvers/follower.py b/resolvers/follower.py index 072ea405..ed81c597 100644 --- a/resolvers/follower.py +++ b/resolvers/follower.py @@ -2,7 +2,7 @@ import json import time from typing import List -from sqlalchemy import or_, select +from sqlalchemy import select from sqlalchemy.sql import and_ from orm.author import Author, AuthorFollower @@ -289,12 +289,12 @@ def author_unfollow(follower_id, slug): @query.field("get_topic_followers") -async def get_topic_followers(_, _info, slug: str, topic_id: int) -> List[Author]: +async def get_topic_followers(_, _info, slug: str) -> List[Author]: topic_followers_query = select(Author) topic_followers_query = ( topic_followers_query.join(TopicFollower, TopicFollower.follower == Author.id) .join(Topic, Topic.id == TopicFollower.topic) - .filter(or_(Topic.slug == slug, Topic.id == topic_id)) + .filter(Topic.slug == slug) ) return get_with_stat(topic_followers_query) diff --git a/schema/query.graphql b/schema/query.graphql index ab83a8b1..f32ad93e 100644 --- a/schema/query.graphql +++ b/schema/query.graphql @@ -12,7 +12,7 @@ type Query { # follower get_shout_followers(slug: String, shout_id: Int): [Author] - get_topic_followers(slug: String, topic_id: Int): [Author] + get_topic_followers(slug: String): [Author] get_author_followers(slug: String, user: String, author_id: Int): [Author] get_author_follows(slug: String, user: String, author_id: Int): CommonResult! get_author_follows_topics(slug: String, user: String, author_id: Int): [Topic]