Mutation
对用户User
进行评论
mutation Mutation($commentableId: ID!, $comment: AssetInput!) {
comment(commentableId: $commentableId, comment: $comment) {
... on User {
id
comments {
totalCount
nodes {
content {
content
}
}
}
}
}
}
对选择题MultipleChoiceExercise
进行评论
mutation Mutation($commentableId: ID!, $comment: AssetInput!) {
comment(commentableId: $commentableId, comment: $comment) {
... on MultipleChoiceExercise {
id
comments {
totalCount
nodes {
content {
content
}
}
}
}
}
}
对代码题CodingExercise
进行评论
mutation Mutation($commentableId: ID!, $comment: AssetInput!) {
comment(commentableId: $commentableId, comment: $comment) {
... on CodingExercise {
id
comments {
totalCount
nodes {
content {
content
}
}
}
}
}
}
对题包ExercisePack
进行评论
mutation Mutation($comment: AssetInput!, $commentableId: ID!) {
comment(comment: $comment, commentableId: $commentableId) {
... on ExercisePack {
id
comments {
totalCount
nodes {
content {
content
}
}
}
}
}
}
对评论Comment
进行评论
mutation Comment($commentableId: ID!, $comment: AssetInput!) {
comment(commentableId: $commentableId, comment: $comment) {
... on Comment {
id
content {
content
}
comments {
nodes {
id
content {
content
}
}
}
}
}
}
修改评论
mutation Mutation($commentId: ID!, $data: CommentInput!) {
modifyComment(commentId: $commentId, data: $data) {
content {
content
}
}
}
删除评论
mutation Mutation($commentId: ID!) {
deleteComment(commentId: $commentId) {
id
}
}
Query
查询我收到的所有评论
query Query {
me {
comments {
totalCount
nodes {
id
content {
content
}
}
}
}
}
查询某资源下的所有可见评论(以CodingExercise
为例)
query Query {
publicCodingExercises {
nodes {
comments {
totalCount
nodes {
id
content {
content
}
}
}
}
}
}