mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Return all actions in CreateCommentResponse
This commit is contained in:
@@ -2,11 +2,10 @@ const RootMutation = {
|
||||
createComment: async (_, {input}, {mutators: {Comment}, loaders: {Actions}}) => {
|
||||
const comment = await Comment.create(input);
|
||||
|
||||
// Retrieve flags that was assigned to comment.
|
||||
// Retrieve actions that was assigned to comment.
|
||||
const actions = await Actions.getByID.load(comment.id);
|
||||
const flags = actions.filter(({action_type}) => action_type === 'FLAG');
|
||||
|
||||
return {comment, flags};
|
||||
return {comment, actions};
|
||||
},
|
||||
editComment: async (_, {id, asset_id, edit: {body}}, {mutators: {Comment}}) => ({
|
||||
comment: await Comment.edit({id, asset_id, edit: {body}}),
|
||||
|
||||
@@ -261,7 +261,7 @@ enum ACTION_TYPE {
|
||||
# CommentsQuery allows the ability to query comments by a specific methods.
|
||||
input CommentsQuery {
|
||||
|
||||
# Author of the comments
|
||||
# Author of the commente
|
||||
author_id: ID
|
||||
|
||||
# Current status of a comment.
|
||||
@@ -877,8 +877,8 @@ type CreateCommentResponse implements Response {
|
||||
# The comment that was created.
|
||||
comment: Comment
|
||||
|
||||
# Flags that was assigned during creation of the comment.
|
||||
flags: [FlagAction]
|
||||
# Actions that was assigned during creation of the comment.
|
||||
actions: [Action]
|
||||
|
||||
# An array of errors relating to the mutation that occurred.
|
||||
errors: [UserError!]
|
||||
|
||||
Reference in New Issue
Block a user