Created
November 26, 2018 17:10
-
-
Save stubailo/b5e6a5865c123417a7ee9d780ba36456 to your computer and use it in GitHub Desktop.
Customizing graphql-tools mocks
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
import faker from 'faker'; | |
const mocks = { | |
Todo: () => ({ | |
text: () => faker.sentence(), | |
completed: () => faker.random.boolean(), | |
}), | |
User: () => ({ | |
name: () => faker.name.findName() | |
}) | |
} | |
addMockFunctionsToSchema({ schema, mocks }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment