This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
- resolvers: added reader.load_shouts_top_random
|
||||
- resolvers: added reader.load_shouts_unrated
|
||||
- resolvers: community follower id property name is .author
|
||||
- resolvers: get_authors_all and load_authors_all
|
||||
- services: auth connector upgraded
|
||||
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -330,6 +330,7 @@ type Query {
|
||||
# author
|
||||
get_author(slug: String, author_id: Int): Author
|
||||
get_author_id(user: String!): Author
|
||||
get_authors_all: [Author]
|
||||
load_authors_all(limit: Int, offset: Int): [Author]
|
||||
get_author_followers(slug: String, user: String, author_id: Int): [Author]
|
||||
get_author_followed(slug: String, user: String, author_id: Int): [Author]
|
||||
|
Reference in New Issue
Block a user