Ocelot-Social/src/middleware/userMiddleware.js
Grzegorz Leoniec 887cc8fddf
Refactoring
2019-01-10 15:59:10 +01:00

17 lines
559 B
JavaScript

import createOrUpdateLocations from './nodes/locations'
export default {
Mutation: {
CreateUser: async (resolve, root, args, context, info) => {
const result = await resolve(root, args, context, info)
await createOrUpdateLocations(args.id, args.locationName, context.driver)
return result
},
UpdateUser: async (resolve, root, args, context, info) => {
const result = await resolve(root, args, context, info)
await createOrUpdateLocations(args.id, args.locationName, context.driver)
return result
}
}
}