Ocelot-Social/backend/src/middleware/userMiddleware.js
2019-03-20 21:00:59 +01:00

20 lines
604 B
JavaScript

import createOrUpdateLocations from './nodes/locations'
import dotenv from 'dotenv'
dotenv.config()
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
}
}
}