From 1a97852efb750b45889f8c91fca3f976aaef9bb0 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Sat, 26 Nov 2022 00:47:13 +0300 Subject: [PATCH] loadchats-api --- src/graphql/query/chats-load.ts | 16 +++++----------- src/utils/apiClient.ts | 4 ++-- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/graphql/query/chats-load.ts b/src/graphql/query/chats-load.ts index 343742eb..c5b87093 100644 --- a/src/graphql/query/chats-load.ts +++ b/src/graphql/query/chats-load.ts @@ -6,22 +6,16 @@ export default gql` error chats { id + admins + users + unread + description + updatedAt messages { id body author } - admins { - slug - name - } - users { - slug - name - } - unread - description - updatedAt } } } diff --git a/src/utils/apiClient.ts b/src/utils/apiClient.ts index 280552d2..9c061e67 100644 --- a/src/utils/apiClient.ts +++ b/src/utils/apiClient.ts @@ -272,8 +272,8 @@ export const apiClient = { // inbox getChats: async (options: QueryLoadChatsArgs) => { const resp = await privateGraphQLClient.query(myChats, options).toPromise() - console.debug('[getChats]', resp) - return resp.data.myChats + console.debug('[loadChats]', resp) + return resp.data.loadChats }, createChat: async (options: MutationCreateChatArgs) => {