Skip to content

Commit 1b47e0c

Browse files
committed
var graphqlHTTP = require('express-graphql'); to var { graphqlHTTP } = require('express-graphql');
1 parent 7fb5e37 commit 1b47e0c

9 files changed

+10
-10
lines changed

site/code/index.html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ npm install express express-graphql graphql
271271
272272
\`\`\`js
273273
var express = require('express');
274-
var graphqlHTTP = require('express-graphql');
274+
var { graphqlHTTP } = require('express-graphql');
275275
var { buildSchema } = require('graphql');
276276
277277
var schema = buildSchema(\`

site/graphql-js/APIReference-ExpressGraphQL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ next: /graphql-js/graphql/
1111

1212
```js
1313
import graphqlHTTP from 'express-graphql'; // ES6
14-
var graphqlHTTP = require('express-graphql'); // CommonJS
14+
var { graphqlHTTP } = require('express-graphql'); // CommonJS
1515
```
1616

1717
### graphqlHTTP

site/graphql-js/Guides-ConstructingTypes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ next: /graphql-js/express-graphql/
1414

1515
```javascript
1616
var express = require('express');
17-
var graphqlHTTP = require('express-graphql');
17+
var { graphqlHTTP } = require('express-graphql');
1818
var { buildSchema } = require('graphql');
1919

2020
var schema = buildSchema(`
@@ -60,7 +60,7 @@ console.log('Running a GraphQL API server at localhost:4000/graphql');
6060

6161
```javascript
6262
var express = require('express');
63-
var graphqlHTTP = require('express-graphql');
63+
var { graphqlHTTP } = require('express-graphql');
6464
var graphql = require('graphql');
6565

6666
// Maps id to User object

site/graphql-js/Tutorial-Authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Express 中间件可以很方便地结合 `express-graphql` 使用,这也是
1515

1616
```javascript
1717
var express = require('express');
18-
var graphqlHTTP = require('express-graphql');
18+
var { graphqlHTTP } = require('express-graphql');
1919
var { buildSchema } = require('graphql');
2020

2121
var schema = buildSchema(`

site/graphql-js/Tutorial-BasicTypes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GraphQL schema language 支持的标量类型有 `String`、`Int`、`Float`、`B
1818

1919
```javascript
2020
var express = require('express');
21-
var graphqlHTTP = require('express-graphql');
21+
var { graphqlHTTP } = require('express-graphql');
2222
var { buildSchema } = require('graphql');
2323

2424
// 使用 GraphQL schema language 构建一个 schema

site/graphql-js/Tutorial-ExpressGraphQL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npm install express express-graphql graphql --save
1717

1818
```javascript
1919
var express = require('express');
20-
var graphqlHTTP = require('express-graphql');
20+
var { graphqlHTTP } = require('express-graphql');
2121
var { buildSchema } = require('graphql');
2222

2323
// 使用 GraphQL Schema Language 创建一个 schema

site/graphql-js/Tutorial-Mutations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ type Mutation {
7373

7474
```javascript
7575
var express = require('express');
76-
var graphqlHTTP = require('express-graphql');
76+
var { graphqlHTTP } = require('express-graphql');
7777
var { buildSchema } = require('graphql');
7878

7979
// 使用 GraphQL schema language 构建 schema

site/graphql-js/Tutorial-ObjectTypes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type Query {
7474

7575
```javascript
7676
var express = require('express');
77-
var graphqlHTTP = require('express-graphql');
77+
var { graphqlHTTP } = require('express-graphql');
7878
var { buildSchema } = require('graphql');
7979

8080
// 用 GraphQL schema language 构造一个 schema

site/graphql-js/Tutorial-PassingArguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var root = {
5858

5959
```javascript
6060
var express = require('express');
61-
var graphqlHTTP = require('express-graphql');
61+
var { graphqlHTTP } = require('express-graphql');
6262
var { buildSchema } = require('graphql');
6363

6464
// 使用 GraphQL schema language 构造一个 schema

0 commit comments

Comments
 (0)