Created
June 5, 2018 11:25
-
-
Save daniele-zurico/2a15f1c28b9cb616ac4bb72bac41a8c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { userController } from "../controllers/controllers"; | |
import { AuthenticationError } from "apollo-server"; | |
const userResolver = { | |
Mutation: { | |
addUser(root: any, args: any) { | |
return userController.addUser(root, args); | |
}, | |
deleteUser(root: any, args: any) { | |
return userController.deleteUser(root, args); | |
}, | |
updateUser(root: any, args: any) { | |
return userController.updateUser(root, args); | |
} | |
}, | |
Query: { | |
allUsers(root: any, args: any, context: any) { | |
//use context if you want to restrict the usage | |
return userController.users(root, args); | |
} | |
} | |
}; | |
export default userResolver; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment