get-authors-all
All checks were successful
deploy / deploy (push) Successful in 2m3s

This commit is contained in:
2023-12-19 11:09:50 +03:00
parent 8e8952dd46
commit f52db8f9e5
4 changed files with 11 additions and 0 deletions

View File

@@ -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)