diff --git a/src/content/code/code.md b/src/content/code/code.md index 047225a853..623d31b891 100644 --- a/src/content/code/code.md +++ b/src/content/code/code.md @@ -304,7 +304,7 @@ var schema = buildSchema(` var root = { hello: () => 'Hello world!' }; -graphql(schema, '{ hello }', root).then((response) => { +graphql({schema, source:'{ hello }', rootValue:root}).then((response) => { console.log(response); }); ``` diff --git a/src/content/graphql-js/Tutorial-GettingStarted.md b/src/content/graphql-js/Tutorial-GettingStarted.md index cbd2a4319e..014f5440c8 100644 --- a/src/content/graphql-js/Tutorial-GettingStarted.md +++ b/src/content/graphql-js/Tutorial-GettingStarted.md @@ -40,7 +40,7 @@ var root = { }; // 运行 GraphQL query '{ hello }' ,输出响应 -graphql(schema, '{ hello }', root).then((response) => { +graphql({schema, source:'{ hello }', rootValue:root}).then((response) => { console.log(response); }); ```