From b7cf082c24252e81f3abc4da7e05fd4758007966 Mon Sep 17 00:00:00 2001 From: yang <2636098325@qq.com> Date: Thu, 15 Jun 2023 10:35:51 +0800 Subject: [PATCH 1/2] [docm] Fix instance code --- src/content/code/code.md | 2 +- src/content/graphql-js/Tutorial-GettingStarted.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/code/code.md b/src/content/code/code.md index 047225a853..b99e5439b9 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: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..79f0c6f483 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:schema, source:'{ hello }', rootValue:root}).then((response) => { console.log(response); }); ``` From 586e3fe86c546815c9471c8d4f70cc74fa46abb9 Mon Sep 17 00:00:00 2001 From: yang <2636098325@qq.com> Date: Fri, 16 Jun 2023 14:28:52 +0800 Subject: [PATCH 2/2] optimized code --- src/content/code/code.md | 2 +- src/content/graphql-js/Tutorial-GettingStarted.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/code/code.md b/src/content/code/code.md index b99e5439b9..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:schema, source:'{ hello }', rootValue: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 79f0c6f483..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:schema, source:'{ hello }', rootValue:root}).then((response) => { +graphql({schema, source:'{ hello }', rootValue:root}).then((response) => { console.log(response); }); ```