Skip to content

Instantly share code, notes, and snippets.

@helfer
Created April 22, 2016 20:37
Show Gist options
  • Save helfer/3dfb4d418ec8d103de63c5ad31a5a90a to your computer and use it in GitHub Desktop.
Save helfer/3dfb4d418ec8d103de63c5ad31a5a90a to your computer and use it in GitHub Desktop.
Mocking file for apollo tutorial
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