add methods for messaging
This commit is contained in:
@@ -35,12 +35,3 @@ type signOutPayload {
|
||||
status: Boolean!
|
||||
error: String
|
||||
}
|
||||
|
||||
type Query{
|
||||
signIn(id: Int!, password: String!): signInPayload!
|
||||
signOut: signOutPayload!
|
||||
}
|
||||
|
||||
type Mutation{
|
||||
registerUser(input: registerUserInput!): User!
|
||||
}
|
||||
|
||||
@@ -1,2 +1,23 @@
|
||||
|
||||
scalar DateTime
|
||||
|
||||
type Query {
|
||||
signIn(id: Int!, password: String!): signInPayload!
|
||||
signOut: signOutPayload!
|
||||
|
||||
getMessages(count: Int = 100, page: Int = 1): [Message!]!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
registerUser(input: registerUserInput!): User!
|
||||
|
||||
createMessage(input: MessageInput!): createMessagePayload!
|
||||
updateMessage(input: updateMessageInput!): createMessagePayload!
|
||||
deleteMessage(id: Int!): deleteMessagePayload!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
messageCreated: Message!
|
||||
messageUpdated: Message!
|
||||
messageDeleted: Message!
|
||||
}
|
||||
|
||||
31
schema/schema.messages.graphql
Normal file
31
schema/schema.messages.graphql
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
type Message {
|
||||
author: Int!
|
||||
body: String!
|
||||
createdAt: DateTime!
|
||||
id: Int!
|
||||
replyTo: Int
|
||||
updatedAt: DateTime!
|
||||
visibleForUsers: [Int]
|
||||
}
|
||||
|
||||
type createMessagePayload {
|
||||
status: Boolean!
|
||||
error: String
|
||||
message: Message
|
||||
}
|
||||
|
||||
type deleteMessagePayload {
|
||||
status: Boolean!
|
||||
error: String
|
||||
}
|
||||
|
||||
input MessageInput {
|
||||
body: String!
|
||||
replyTo: Int
|
||||
}
|
||||
|
||||
input updateMessageInput {
|
||||
id: Int!
|
||||
body: String!
|
||||
}
|
||||
Reference in New Issue
Block a user