552-update_comment

This commit is contained in:
ALau2088 2019-05-30 15:47:55 -07:00
parent 8c7009097a
commit a5f6390f97
3 changed files with 8 additions and 11 deletions

View File

@ -7,7 +7,9 @@ const validateUsername = async (resolve, root, args, context, info) => {
/* eslint-disable-next-line no-return-await */
return await resolve(root, args, context, info)
} else {
throw new UserInputError(`Username must be at least ${USERNAME_MIN_LENGTH} characters long!`)
throw new UserInputError(
`Username must be at least ${USERNAME_MIN_LENGTH} characters long!`
)
}
}
@ -35,8 +37,7 @@ const validateComment = async (resolve, root, args, context, info) => {
if (!postId) {
throw new UserInputError(NO_POST_ERR_MESSAGE)
}
return await resolve(root, args, context, info)
return resolve(root, args, context, info)
}
export default {

View File

@ -1,6 +1,8 @@
import { neo4jgraphql } from 'neo4j-graphql-js'
import { UserInputError } from 'apollo-server'
const NO_POST_ERR_MESSAGE = 'Comment cannot be created without a post!'
export default {
Mutation: {
CreateComment: async (object, params, context, resolveInfo) => {
@ -52,13 +54,7 @@ export default {
return comment
},
UpdateComment: async (object, params, context, resolveInfo) => {
const commentRev = await neo4jgraphql(
object,
params,
context,
resolveInfo,
false
)
await neo4jgraphql(object, params, context, resolveInfo, false)
}
}
}

View File

@ -104,4 +104,4 @@
"vue-jest": "~3.0.4",
"vue-svg-loader": "~0.12.0"
}
}
}