This commit is contained in:
2021-12-05 23:23:48 +03:00
parent cf020f8f3e
commit 7d75480217
4 changed files with 19 additions and 5 deletions

View File

@@ -68,10 +68,16 @@ type MessageWithStatus {
message: Message!
}
type ChatRoomResult {
messages: [Message]!
room: ChatRoom!
}
################################### Mutation
type Mutation {
# message
getRoom(chatRoom: Int!): ChatRoomResult! # TODO: private rooms protection
createMessage(body: String!, replyTo: Int): MessageResult!
updateMessage(id: Int!, body: String!): MessageResult!
deleteMessage(messageId: Int!): Result!
@@ -162,7 +168,7 @@ type Query {
type Subscription {
messageChanged: MessageWithStatus!
chatUpdated: ChatRoomResult!
onlineUpdated: [User!]!
shoutUpdated: Shout!
userUpdated: User!
@@ -237,6 +243,7 @@ type User {
type Message {
author: Int!
chatRoom: Int!
body: String!
createdAt: DateTime!
id: Int!
@@ -245,6 +252,13 @@ type Message {
visibleForUsers: [Int]!
}
type ChatRoom {
id: Int!
createdAt: DateTime!
updatedAt: DateTime!
notes: String
}
type Comment {
id: Int!
author: User!