Created
April 22, 2016 20:37
-
-
Save helfer/3dfb4d418ec8d103de63c5ad31a5a90a to your computer and use it in GitHub Desktop.
Mocking file for apollo tutorial
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 casual from 'casual'; | |
const mocks = { | |
String: () => 'It works!', | |
Query: () => ({ | |
author: (root, args) => { | |
return { firstName: args.firstName, lastName: args.lastName }; | |
}, | |
}), | |
Author: () => ({ firstName: () => casual.first_name, lastName: () => casual.last_name }), | |
Post: () => ({ title: casual.title, text: casual.sentences(3) }), | |
}; | |
export default mocks; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment