Last active
April 12, 2018 08:04
-
-
Save wojciech-bilicki/604f4c4acaca019f1409b28d6757cd3c 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
Mutation: { | |
addAuthor: (root, {name, age, Books}) => { | |
const author = new authorModel({name, age, Books}) | |
return author.save() | |
}, | |
deleteAuthor: (root, {id}) => { | |
return authorModel.findOneAndRemove({id: id}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment