followed-by
All checks were successful
Deploy on push / deploy (push) Successful in 1m9s

This commit is contained in:
2024-07-03 15:35:12 +03:00
parent d55a3050fc
commit 1223c633d4
3 changed files with 18 additions and 1 deletions

View File

@@ -496,3 +496,17 @@ async def load_shouts_followed(_, info, limit=50, offset=0) -> List[Shout]:
except Exception as error:
logger.debug(error)
return []
@query.field("load_shouts_followed_by")
async def load_shouts_followed_by(_, info, slug: str, limit=50, offset=0) -> List[Shout]:
with local_session() as session:
author = session.query(Author).filter(Author.slug == slug).first()
if author:
try:
author_id: int = author.dict()["id"]
shouts = await reacted_shouts_updates(author_id, limit, offset)
return shouts
except Exception as error:
logger.debug(error)
return []