148 lines
3.2 KiB
GraphQL
148 lines
3.2 KiB
GraphQL
extend type Query {
|
|
comment(id: String!, streamId: String!): Comment
|
|
|
|
comments(streamId: String!, resources: [ResourceIdentifierInput]!, limit: Int = 25, cursor: String): CommentCollection
|
|
}
|
|
|
|
type Comment {
|
|
id: String!
|
|
authorId: String!
|
|
archived: Boolean!
|
|
screenshot: String
|
|
text: String!
|
|
data: JSONObject!
|
|
resources: [ResourceIdentifier]!
|
|
createdAt: DateTime
|
|
updatedAt: DateTime
|
|
replies(limit: Int = 25, cursor: String): CommentCollection
|
|
reactions: [String]
|
|
}
|
|
|
|
type CommentCollection {
|
|
totalCount: Int!
|
|
cursor: DateTime
|
|
items: [Comment]!
|
|
}
|
|
|
|
type ResourceIdentifier {
|
|
resourceId: String!
|
|
resourceType: ResourceType!
|
|
}
|
|
|
|
input ResourceIdentifierInput {
|
|
resourceId: String!
|
|
resourceType: ResourceType!
|
|
}
|
|
|
|
enum ResourceType {
|
|
comment
|
|
object
|
|
commit
|
|
stream
|
|
}
|
|
|
|
# type CommentReply {
|
|
# id: String!
|
|
# authorId: String!
|
|
# archived: Boolean!
|
|
# createdAt: DateTime!
|
|
# updatedAt: DateTime!
|
|
# text: String!
|
|
# }
|
|
|
|
input CommentCreateInput {
|
|
streamId: String!
|
|
resources: [ResourceIdentifierInput]!
|
|
text: String!
|
|
data: JSONObject!
|
|
screenshot: String
|
|
}
|
|
|
|
input ReplyCreateInput {
|
|
streamId: String!
|
|
parentComment: String!
|
|
text: String!
|
|
data: JSONObject!
|
|
}
|
|
|
|
input CommentEditInput {
|
|
streamId: String!
|
|
id: String!
|
|
text: String!
|
|
data: JSONObject!
|
|
}
|
|
|
|
input ReplyEditInput {
|
|
id: String!
|
|
text: String!
|
|
archived: Boolean
|
|
}
|
|
|
|
# extend type Stream {
|
|
# comments(
|
|
# limit: Int! = 20
|
|
# archived: Boolean = false
|
|
# cursor: String
|
|
# ): CommentCollection
|
|
# comment(id: String!): Comment
|
|
# }
|
|
|
|
# extend type Commit {
|
|
# comments(
|
|
# limit: Int! = 20
|
|
# archived: Boolean = false
|
|
# cursor: String
|
|
# ): CommentCollection
|
|
# }
|
|
|
|
# extend type Object {
|
|
# comments(
|
|
# limit: Int! = 20
|
|
# archived: Boolean = false
|
|
# cursor: String
|
|
# ): CommentCollection
|
|
# }
|
|
|
|
extend type Mutation {
|
|
# Used for broadcasting real time chat head bubbles and status.
|
|
userCommentActivityBroadcast(
|
|
streamId: String!
|
|
resourceId: String!
|
|
data: JSONObject
|
|
): Boolean! @hasRole(role: "server:user") @hasScope(scope: "streams:read")
|
|
|
|
commentCreate(input: CommentCreateInput! ): String!
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "streams:read")
|
|
|
|
commentEdit(streamId: String!, comment: JSONObject!): Boolean!
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "streams:read")
|
|
|
|
commentReply( input: ReplyCreateInput! ): String!
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "streams:read")
|
|
|
|
commentReactionToggle(streamId: String!, commentId: String!, reaction: String!): Boolean!
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "streams:read")
|
|
|
|
# commentReplyEdit(streamId: String!, commentReply: JSONObject!): Boolean!
|
|
# @hasRole(role: "server:user")
|
|
# @hasScope(scope: "streams:read")
|
|
}
|
|
|
|
extend type Subscription {
|
|
userCommentActivity(streamId: String!, resourceId: String!): JSONObject
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "streams:read")
|
|
|
|
commentCreated(streamId: String!, resourceId: String!): JSONObject
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "streams:read")
|
|
|
|
commentReplyCreated(streamId: String!, commentId: String!): JSONObject
|
|
@hasRole(role: "server:user")
|
|
@hasScope(scope: "streams:read")
|
|
}
|