diff --git a/src/content/graphql-js/Tutorial-GettingStarted.md b/src/content/graphql-js/Tutorial-GettingStarted.md index 951387226e..945a863b47 100644 --- a/src/content/graphql-js/Tutorial-GettingStarted.md +++ b/src/content/graphql-js/Tutorial-GettingStarted.md @@ -32,15 +32,19 @@ var schema = buildSchema(` } `); -// The root provides a resolver function for each API endpoint -var root = { +// The rootValue provides a resolver function for each API endpoint +var rootValue = { hello: () => { return 'Hello world!'; }, }; // Run the GraphQL query '{ hello }' and print out the response -graphql(schema, '{ hello }', root).then((response) => { +graphql({ + schema, + source: '{ hello }', + rootValue +}).then((response) => { console.log(response); }); ```