Skip to content

Commit 46cfcba

Browse files
authored
update to use object with graphql() vs 3 params
1 parent c9417e4 commit 46cfcba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ var schema = buildSchema(`
3333
`);
3434

3535
// The root provides a resolver function for each API endpoint
36-
var root = {
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)