From 31824cccc9e8c12cd3223e65ba6d52d80ee3754b Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 13 Oct 2023 13:45:27 +0300 Subject: [PATCH] few-more-resolvers-fix --- resolvers/__init__.py | 8 ++++++++ resolvers/profile.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/resolvers/__init__.py b/resolvers/__init__.py index b14915a1..26cc90cd 100644 --- a/resolvers/__init__.py +++ b/resolvers/__init__.py @@ -14,6 +14,10 @@ from resolvers.profile import ( rate_user, update_profile, get_authors_all, + get_followed_authors2, + get_followed_authors, + get_author, + get_author_by_id ) from resolvers.topics import ( @@ -52,6 +56,10 @@ __all__ = [ "rate_user", "update_profile", "get_authors_all", + "get_followed_authors2", + "get_followed_authors", + "get_author", + "get_author_by_id", # load "load_shout", "load_shouts_by", diff --git a/resolvers/profile.py b/resolvers/profile.py index 7d821aae..f3fb384e 100644 --- a/resolvers/profile.py +++ b/resolvers/profile.py @@ -142,6 +142,7 @@ async def get_followed_authors(_, _info, slug) -> List[User]: return await followed_authors(user_id) + @query.field("authorFollowedAuthors") async def get_followed_authors2(_, info, author_id) -> List[User]: return await followed_authors(author_id) @@ -266,7 +267,7 @@ async def get_authors_all(_, _info): @query.field("getAuthorById") -async def get_author(_, _info, author_id): +async def get_author_by_id(_, _info, author_id): q = select(User).where(User.id == author_id) q = add_author_stat_columns(q)