diff --git a/resolvers/editor.py b/resolvers/editor.py index 97bcb6bb..4d9e6b7c 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -1,6 +1,6 @@ import time -from sqlalchemy import and_, select +from sqlalchemy import and_, select, desc from sqlalchemy.orm import joinedload from orm.author import Author @@ -31,6 +31,7 @@ async def get_shouts_drafts(_, info): .options(joinedload(Shout.authors), joinedload(Shout.topics)) .filter(and_(Shout.deleted_at.is_(None), Shout.created_by == author.id)) .filter(Shout.published_at.is_(None)) + .order_by(desc(Shout.created_at)) .group_by(Shout.id) ) shouts = [shout for [shout] in session.execute(q).unique()]