diff --git a/resolvers/editor.py b/resolvers/editor.py index 19f1fc33..e8c14f45 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -83,9 +83,7 @@ async def get_shouts_drafts(_, info): # user_id = info.context.get("user_id") author_dict = info.context.get("author") if not author_dict: - logger.error("trying to get drafts failed") - # logger.debug(info) - return [] + return {"error": "author profile was not found"} author_id = author_dict.get("id") shouts = [] with local_session() as session: diff --git a/schema/query.graphql b/schema/query.graphql index fcb3a2fa..ca521f90 100644 --- a/schema/query.graphql +++ b/schema/query.graphql @@ -33,7 +33,7 @@ type Query { # editor get_my_shout(shout_id: Int!): CommonResult! - get_shouts_drafts: [Shout] + get_shouts_drafts: CommonResult! # topic get_topic(slug: String!): Topic