Skip to content

Commit cf37a86

Browse files
authored
Merge pull request graphql#1186 from thall1961/patch-1
update to use object with graphql() vs 3 params
2 parents 24a5812 + 89cb6ce commit cf37a86

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/content/graphql-js/Tutorial-GettingStarted.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,19 @@ var schema = buildSchema(`
3232
}
3333
`);
3434

35-
// The root provides a resolver function for each API endpoint
36-
var root = {
35+
// The rootValue provides a resolver function for each API endpoint
36+
var rootValue = {
3737
hello: () => {
3838
return 'Hello world!';
3939
},
4040
};
4141

4242
// Run the GraphQL query '{ hello }' and print out the response
43-
graphql(schema, '{ hello }', root).then((response) => {
43+
graphql({
44+
schema,
45+
source: '{ hello }',
46+
rootValue
47+
}).then((response) => {
4448
console.log(response);
4549
});
4650
```

0 commit comments

Comments
 (0)