fix-queries

This commit is contained in:
tonyrewin 2022-11-03 09:07:57 +03:00
parent 3af9f5d7e4
commit 2142837d34
2 changed files with 25 additions and 18 deletions

View File

@ -3,6 +3,11 @@ import { gql } from '@urql/core'
export default gql` export default gql`
query GetChatsQuery { query GetChatsQuery {
myChats { myChats {
error
chats {
title
description
updatedAt
messages { messages {
id id
author author
@ -15,8 +20,7 @@ export default gql`
name name
userpic userpic
} }
title }
createdAt
} }
} }
` `

View File

@ -3,6 +3,8 @@ import { gql } from '@urql/core'
export default gql` export default gql`
query LoadMessagesQuery($chatId: String!, $offset: Int, $amount: Int) { query LoadMessagesQuery($chatId: String!, $offset: Int, $amount: Int) {
loadChat(chatId: $chatId, offset: $offset, amount: $amount) { loadChat(chatId: $chatId, offset: $offset, amount: $amount) {
error
messages {
author author
body body
createdAt createdAt
@ -10,4 +12,5 @@ export default gql`
seen seen
} }
} }
}
` `