diff --git a/src/graphql/query/im-chats.ts b/src/graphql/query/im-chats.ts index a87f7b34..1fb48553 100644 --- a/src/graphql/query/im-chats.ts +++ b/src/graphql/query/im-chats.ts @@ -3,20 +3,24 @@ import { gql } from '@urql/core' export default gql` query GetChatsQuery { myChats { - messages { - id - author - body - replyTo - createdAt + error + chats { + title + description + updatedAt + messages { + id + author + body + replyTo + createdAt + } + users { + slug + name + userpic + } } - users { - slug - name - userpic - } - title - createdAt } } ` diff --git a/src/graphql/query/im-load-messages.ts b/src/graphql/query/im-load-messages.ts index d9ae1404..ec3b83bf 100644 --- a/src/graphql/query/im-load-messages.ts +++ b/src/graphql/query/im-load-messages.ts @@ -3,11 +3,14 @@ import { gql } from '@urql/core' export default gql` query LoadMessagesQuery($chatId: String!, $offset: Int, $amount: Int) { loadChat(chatId: $chatId, offset: $offset, amount: $amount) { - author - body - createdAt - updatedAt - seen + error + messages { + author + body + createdAt + updatedAt + seen + } } } `