This commit is contained in:
Igor Lobanov
2022-11-18 03:19:10 +01:00
parent aee83c31b5
commit f0fc09b1a1
4 changed files with 19 additions and 18 deletions

View File

@@ -18,15 +18,18 @@ from services.stat.reacted import ReactedStorage
@query.field("loadShout")
async def load_shout(_, info, slug):
shout = select(Shout).options(
# TODO add cation
selectinload(Shout.authors),
selectinload(Shout.topics),
).where(
Shout.deletedAt.is_(None)
).one()
with local_session() as session:
shout = session.query(Shout).options(
# TODO add cation
selectinload(Shout.authors),
selectinload(Shout.topics),
).filter(
Shout.slug == slug
).filter(
Shout.deletedAt.is_(None)
).one()
return shout
return shout
@query.field("loadShouts")