Skip to content

Instantly share code, notes, and snippets.

@wojciech-bilicki
Last active April 12, 2018 08:04
Show Gist options
  • Save wojciech-bilicki/604f4c4acaca019f1409b28d6757cd3c to your computer and use it in GitHub Desktop.
Save wojciech-bilicki/604f4c4acaca019f1409b28d6757cd3c to your computer and use it in GitHub Desktop.
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