Last active
March 11, 2020 21:18
-
-
Save helfer/586e32a2852059cc5e7d6889ea771ed1 to your computer and use it in GitHub Desktop.
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
// > npm install graphql-tools | |
import { mockServer } from 'graphql-tools'; | |
import schema from './mySchema.graphql'; | |
const myMockServer = mockServer(schema); | |
myMockServer.query(`{ | |
allUsers: { | |
id | |
name | |
} | |
}`); | |
// returns | |
// { | |
// data: { | |
// allUsers:[ | |
// { id: 'ee5ae76d-9b91-4270-a007-fad2054e2e75', name: 'lorem ipsum' }, | |
// { id: 'ca5c182b-99a8-4391-b4b4-4a20bd7cb13a', name: 'quis ut' } | |
// ] | |
// } | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems there's a typo on line 8. Wouldn't it be
allUsers {
(without the colon)?