Created
January 4, 2018 11:51
-
-
Save jbaxleyiii/743067471f6fc4b1a8df747ddda6bcc3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: { | |
| upvotePost: (_, { postId }) => { | |
| const post = find(posts, { id: postId }); | |
| if (!post) { | |
| throw new Error(`Couldn't find post with id ${postId}`); | |
| } | |
| post.votes += 1; | |
| return post; | |
| }, | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment