mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
createCommentInput
This commit is contained in:
@@ -2,7 +2,7 @@ const wrapResponse = require('../helpers/response');
|
||||
const CommentsService = require('../../services/comments');
|
||||
|
||||
const RootMutation = {
|
||||
createComment(_, {asset_id, parent_id, body}, {mutators: {Comment}}) {
|
||||
createComment(_, {comment: {asset_id, parent_id, body}}, {mutators: {Comment}}) {
|
||||
return wrapResponse('comment')(Comment.create({asset_id, parent_id, body}));
|
||||
},
|
||||
createLike(_, {like: {item_id, item_type}}, {mutators: {Action}}) {
|
||||
|
||||
+24
-1
@@ -593,6 +593,29 @@ input CreateLikeInput {
|
||||
item_type: ACTION_ITEM_TYPE!
|
||||
}
|
||||
|
||||
|
||||
|
||||
enum TAG {
|
||||
STAFF
|
||||
OFF_TOPIC
|
||||
}
|
||||
|
||||
input CreateCommentInput {
|
||||
|
||||
# The asset id
|
||||
asset_id: ID!
|
||||
|
||||
# The id of the parent comment
|
||||
parent_id: ID
|
||||
|
||||
# The body of the comment
|
||||
body: String!
|
||||
|
||||
# Tags
|
||||
tags: [TAG]
|
||||
|
||||
}
|
||||
|
||||
type CreateLikeResponse implements Response {
|
||||
|
||||
# The like that was created.
|
||||
@@ -707,7 +730,7 @@ type RemoveCommentTagResponse implements Response {
|
||||
type RootMutation {
|
||||
|
||||
# Creates a comment on the asset.
|
||||
createComment(asset_id: ID!, parent_id: ID, body: String!): CreateCommentResponse
|
||||
createComment(comment: CreateCommentInput!): CreateCommentResponse
|
||||
|
||||
# Creates a like on an entity.
|
||||
createLike(like: CreateLikeInput!): CreateLikeResponse
|
||||
|
||||
Reference in New Issue
Block a user