This commit is contained in:
@@ -3,6 +3,7 @@ from resolvers.author import (
|
||||
get_author_followed,
|
||||
get_author_followers,
|
||||
get_author_id,
|
||||
get_authors_all,
|
||||
load_authors_all,
|
||||
load_authors_by,
|
||||
rate_author,
|
||||
@@ -32,6 +33,7 @@ __all__ = [
|
||||
# author
|
||||
"get_author",
|
||||
"get_author_id",
|
||||
"get_authors_all",
|
||||
"load_authors_all",
|
||||
"get_author_followers",
|
||||
"get_author_followed",
|
||||
|
@@ -152,6 +152,13 @@ def author_unfollow(follower_id, slug):
|
||||
return False
|
||||
|
||||
|
||||
# TODO: caching query
|
||||
@query.field("get_authors_all")
|
||||
async def get_authors_all(_, _info):
|
||||
with local_session() as session:
|
||||
return session.query(Author).join(ShoutAuthor, Author.id == ShoutAuthor.author).all()
|
||||
|
||||
|
||||
@query.field("load_authors_all")
|
||||
async def load_authors_all(_, _info, limit: int = 50, offset: int = 0):
|
||||
q = select(Author)
|
||||
|
Reference in New Issue
Block a user