Skip to content

Commit 4505c53

Browse files
committed
docs(example): switch to graphql-server-express
1 parent fcc9e5b commit 4505c53

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/hello-world/api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import express from 'express';
22
import bodyParser from 'body-parser';
33
import cors from 'cors';
44

5-
import { apolloExpress, graphiqlExpress } from 'apollo-server';
5+
import { graphqlExpress, graphiqlExpress } from 'graphql-server-express';
66
import { makeExecutableSchema } from 'graphql-tools';
77

88
import { schema, resolvers } from './schema';
@@ -14,7 +14,7 @@ const app = express();
1414
app.use(bodyParser.urlencoded({ extended: true }));
1515
app.use(bodyParser.json());
1616

17-
app.use('/graphql', apolloExpress((req) => {
17+
app.use('/graphql', graphqlExpress((req) => {
1818
// Get the query, the same way express-graphql does it
1919
// https://github.com/graphql/express-graphql/blob/3fa6e68582d6d933d37fa9e841da5d2aa39261cd/src/index.js#L257
2020
const query = req.query.query || req.body.query;

examples/hello-world/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"@types/isomorphic-fetch": "0.0.30",
3636
"@types/node": "^6.0.38",
3737
"angular-cli": "1.0.0-beta.21",
38-
"apollo-server": "^0.2.6",
3938
"babel-cli": "^6.14.0",
4039
"babel-core": "^6.14.0",
4140
"babel-preset-es2015": "^6.14.0",
@@ -47,7 +46,8 @@
4746
"concurrently": "^2.2.0",
4847
"cors": "^2.8.0",
4948
"express": "^4.14.0",
50-
"graphql": "~0.7.0",
49+
"graphql": "~0.8.2",
50+
"graphql-server-express": "~0.4.3",
5151
"graphql-tools": "~0.8.0",
5252
"nodemon": "^1.10.2",
5353
"rollup": "^0.36.3",

0 commit comments

Comments
 (0)