We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 24a5812 + 89cb6ce commit cf37a86Copy full SHA for cf37a86
src/content/graphql-js/Tutorial-GettingStarted.md
@@ -32,15 +32,19 @@ var schema = buildSchema(`
32
}
33
`);
34
35
-// The root provides a resolver function for each API endpoint
36
-var root = {
+// The rootValue provides a resolver function for each API endpoint
+var rootValue = {
37
hello: () => {
38
return 'Hello world!';
39
},
40
};
41
42
// Run the GraphQL query '{ hello }' and print out the response
43
-graphql(schema, '{ hello }', root).then((response) => {
+graphql({
44
+ schema,
45
+ source: '{ hello }',
46
+ rootValue
47
+}).then((response) => {
48
console.log(response);
49
});
50
```
0 commit comments