Extend backend to support new suspend feature

This commit is contained in:
Chi Vinh Le
2017-05-17 20:05:18 +07:00
parent 97121382c7
commit 71c743dda7
11 changed files with 94 additions and 49 deletions
+20 -3
View File
@@ -669,6 +669,23 @@ input CreateDontAgreeInput {
message: String
}
# Input for suspendUser mutation.
input SuspendUserInput {
# id of target user.
id: ID!
# message to be sent to the user.
# TODO: should this be required?
message: String
# If set, the user is requested to change its username.
mustChangeUsername: Boolean
# If set, the suspension lasts at least until specified date.
until: Date
}
# DeleteActionResponse is the response returned with possibly some errors
# relating to the delete action attempt.
type DeleteActionResponse implements Response {
@@ -741,7 +758,7 @@ type EditCommentResponse implements Response {
comment: Comment
# An array of errors relating to the mutation that occured.
errors: [UserError]
errors: [UserError]
}
# All mutations for the application are defined on this object.
@@ -765,8 +782,8 @@ type RootMutation {
# Sets User status. Requires the `ADMIN` role.
setUserStatus(id: ID!, status: USER_STATUS!): SetUserStatusResponse
# Sets User status to BANNED and canEditName to true. It sends a message to the banned User. Requires the `ADMIN` role.
suspendUser(id: ID!, message: String): SuspendUserResponse
# Suspends a user. Requires the `ADMIN` role.
suspendUser(input: SuspendUserInput!): SuspendUserResponse
# Sets Comment status. Requires the `ADMIN` role.
setCommentStatus(id: ID!, status: COMMENT_STATUS!): SetCommentStatusResponse