Created
December 10, 2018 21:04
-
-
Save kkworden/edd1f4e05f64643fb59271d2a633eaef to your computer and use it in GitHub Desktop.
Resolvers for the query and mutation operations
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
let messages = []; | |
const resolvers = { | |
messages: () => { | |
return messages; | |
}, | |
sendMessage: ({nickname, message}) => { | |
messages.push(`${nickname}: ${message}`); | |
return true; | |
}, | |
}; | |
module.exports = resolvers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment