From 32fc9646a36e8b0ce1eb75fab2a331018547ef0b Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 13 Oct 2023 21:09:20 +0300 Subject: [PATCH] create-msg-fix2 --- inbox.graphql | 2 +- resolvers/messages.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inbox.graphql b/inbox.graphql index 6d49ebe..85c944d 100644 --- a/inbox.graphql +++ b/inbox.graphql @@ -44,7 +44,7 @@ type Mutation { updateChat(chat: ChatInput!): ChatResult! deleteChat(chatId: String!): ChatResult! - createMessage(chat: String!, body: String!, replyTo: Int): ChatResult! + createMessage(chatId: String!, body: String!, replyTo: Int): ChatResult! updateMessage(chatId: String!, id: Int!, body: String!): ChatResult! deleteMessage(chatId: String!, id: Int!): ChatResult! markAsRead(chatId: String!, ids: [Int]!): ChatResult! diff --git a/resolvers/messages.py b/resolvers/messages.py index f8efa57..7576a0c 100644 --- a/resolvers/messages.py +++ b/resolvers/messages.py @@ -10,7 +10,7 @@ from services.schema import mutation @mutation.field("createMessage") @login_required -async def create_message(_, info, chat_id: str, body: str, reply_to=None): +async def create_message(_, info, chatId: str, body: str, reply_to=None): """ create message with :body for @@ -19,7 +19,7 @@ async def create_message(_, info, chat_id: str, body: str, reply_to=None): """ author_id = info.context["author_id"] - chat_data = await redis.execute("GET", f"chats/{chat_id}") + chat_data = await redis.execute("GET", f"chats/{chatId}") if not chat_data: return {"error": "chat is not exist"} else: