This commit is contained in:
@@ -2,7 +2,7 @@ from resolvers.editor import create_shout, delete_shout, update_shout
|
||||
|
||||
from resolvers.author import (
|
||||
get_author,
|
||||
get_authors_all,
|
||||
load_authors_all,
|
||||
get_author_followers,
|
||||
get_author_followed,
|
||||
load_authors_by,
|
||||
@@ -31,7 +31,7 @@ from resolvers.community import get_community, get_communities_all
|
||||
__all__ = [
|
||||
# author
|
||||
"get_author",
|
||||
"get_authors_all",
|
||||
"load_authors_all",
|
||||
"get_author_followers",
|
||||
"get_author_followed",
|
||||
"load_authors_by",
|
||||
|
@@ -151,11 +151,12 @@ def author_unfollow(follower_id, slug):
|
||||
return False
|
||||
|
||||
|
||||
@query.field("get_authors_all")
|
||||
async def get_authors_all(_, _info):
|
||||
@query.field("load_authors_all")
|
||||
async def load_authors_all(_, _info, limit: int = 50, offset: int = 0):
|
||||
q = select(Author)
|
||||
q = add_author_stat_columns(q)
|
||||
q = q.join(ShoutAuthor, Author.id == ShoutAuthor.author)
|
||||
q = q.limit(limit).offset(offset)
|
||||
|
||||
return get_authors_from_query(q)
|
||||
|
||||
|
Reference in New Issue
Block a user