2020-04-07 02:21:42 +00:00
|
|
|
# ===============================================
|
|
|
|
# COMMENT
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
comments: CommentQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
comments: CommentMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type CommentQuery {
|
|
|
|
providers: [CommentProvider] @auth(requires: ["manage:system"])
|
2020-05-21 03:35:39 +00:00
|
|
|
|
|
|
|
list(
|
2020-05-31 06:13:41 +00:00
|
|
|
locale: String!
|
|
|
|
path: String!
|
2020-05-21 03:35:39 +00:00
|
|
|
): [CommentPost]! @auth(requires: ["read:comments", "manage:system"])
|
|
|
|
|
|
|
|
single(
|
|
|
|
id: Int!
|
|
|
|
): CommentPost @auth(requires: ["read:comments", "manage:system"])
|
2020-04-07 02:21:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type CommentMutation {
|
|
|
|
updateProviders(
|
|
|
|
providers: [CommentProviderInput]
|
|
|
|
): DefaultResponse @auth(requires: ["manage:system"])
|
|
|
|
|
2020-05-21 03:35:39 +00:00
|
|
|
create(
|
|
|
|
pageId: Int!
|
|
|
|
replyTo: Int
|
|
|
|
content: String!
|
2020-05-27 02:56:11 +00:00
|
|
|
guestName: String
|
|
|
|
guestEmail: String
|
2020-05-31 19:54:20 +00:00
|
|
|
): CommentCreateResponse @auth(requires: ["write:comments", "manage:system"]) @rateLimit(limit: 1, duration: 15)
|
2020-05-21 03:35:39 +00:00
|
|
|
|
|
|
|
update(
|
|
|
|
id: Int!
|
|
|
|
content: String!
|
2020-05-31 22:15:15 +00:00
|
|
|
): CommentUpdateResponse @auth(requires: ["write:comments", "manage:comments", "manage:system"])
|
2020-05-27 02:56:11 +00:00
|
|
|
|
|
|
|
delete(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["manage:comments", "manage:system"])
|
2020-04-07 02:21:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type CommentProvider {
|
|
|
|
isEnabled: Boolean!
|
|
|
|
key: String!
|
|
|
|
title: String!
|
|
|
|
description: String
|
|
|
|
logo: String
|
|
|
|
website: String
|
|
|
|
isAvailable: Boolean
|
|
|
|
config: [KeyValuePair]
|
|
|
|
}
|
|
|
|
|
|
|
|
input CommentProviderInput {
|
|
|
|
isEnabled: Boolean!
|
|
|
|
key: String!
|
|
|
|
config: [KeyValuePairInput]
|
|
|
|
}
|
2020-05-21 03:35:39 +00:00
|
|
|
|
|
|
|
type CommentPost {
|
|
|
|
id: Int!
|
2020-05-31 22:15:15 +00:00
|
|
|
content: String! @auth(requires: ["write:comments", "manage:comments", "manage:system"])
|
2020-05-21 03:35:39 +00:00
|
|
|
render: String!
|
|
|
|
authorId: Int!
|
|
|
|
authorName: String!
|
|
|
|
authorEmail: String! @auth(requires: ["manage:system"])
|
|
|
|
authorIP: String! @auth(requires: ["manage:system"])
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|
2020-05-31 06:13:41 +00:00
|
|
|
|
|
|
|
type CommentCreateResponse {
|
|
|
|
responseResult: ResponseStatus
|
|
|
|
id: Int
|
|
|
|
}
|
2020-05-31 22:15:15 +00:00
|
|
|
|
|
|
|
type CommentUpdateResponse {
|
|
|
|
responseResult: ResponseStatus
|
|
|
|
render: String
|
|
|
|
}
|