Do not catch issues on user assign at post create

This commit is contained in:
Grzegorz Leoniec 2019-02-04 17:20:04 +01:00
parent ca076bbcb9
commit cc5701a193
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377

View File

@ -16,18 +16,15 @@ export default {
CreatePost: async (resolve, root, args, context, info) => {
const result = await resolve(root, args, context, info)
try {
const session = context.driver.session()
await session.run(
'MATCH (author:User {id: $userId}), (post:Post {id: $postId}) ' +
'MERGE (post)<-[:WROTE]-(author) ' +
'RETURN author', {
userId: context.user.id,
postId: result.id
})
session.close()
// eslint-disable-next-line no-empty
} catch (err) {}
const session = context.driver.session()
await session.run(
'MATCH (author:User {id: $userId}), (post:Post {id: $postId}) ' +
'MERGE (post)<-[:WROTE]-(author) ' +
'RETURN author', {
userId: context.user.id,
postId: result.id
})
session.close()
return result
}