create-graphql-server
create-graphql-server copied to clipboard
Update apollo version
Here is my diff from upgrading:
diff --git a/.babelrc b/.babelrc
index 9e3d274..f2e3127 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,6 +1,3 @@
{
- "presets": [
- "es2015",
- "stage-2"
- ]
+ "presets": ["env", "stage-2"]
}
diff --git a/package.json b/package.json
index e03aeb8..f68108f 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
"babel-cli": "6.16.0",
"babel-core": "6.17.0",
"babel-eslint": "7.0.0",
- "babel-preset-es2015": "6.16.0",
+ "babel-preset-env": "^1.6.1",
"babel-preset-react": "6.16.0",
"babel-preset-stage-2": "6.17.0",
"babel-register": "6.16.3",
@@ -30,6 +30,7 @@
"nodemon": "1.11.0"
},
"dependencies": {
+ "apollo-server-express": "^1.2.0",
+ "graphql": "^0.11.7",
+ "graphql-tools": "^2.6.1",
- "graphql": "0.7.2",
- "graphql-server": "^0.3.2",
- "graphql-server-express": "^0.4.3",
- "graphql-tools": "^0.8.2",
"bcrypt": "^1.0.2",
"body-parser": "1.15.2",
diff --git a/server/index.js b/server/index.js
index a722448..5b3c63b 100644
--- a/server/index.js
+++ b/server/index.js
@@ -1,5 +1,5 @@
import express from 'express'
-import { graphqlExpress, graphiqlExpress } from 'graphql-server-express'
+import { graphqlExpress, graphiqlExpress } from 'apollo-server-express'
import { createServer } from 'http'
import { SubscriptionServer } from 'subscriptions-transport-ws'
import bodyParser from 'body-parser'
It's working, but prints this error:
Name "__placeholder" must not begin with "__", which is reserved by GraphQL introspection. In a future release of graphql this will become a hard error.
And I get an error when I remove the __placeholder fields. Could do a single underscore, but then it shows up first in GraphiQL suggested field list

Yeah the thing is we need to have some field in the initial schema we create. Although perhaps this restriction has been lifted?
Still the case:
Error: Mutation fields must be an object with field names as keys or a function which returns such an object.
Guess you could, when the first type is added, eg remove type Mutation from index.js, and change eg Type.graphql from extends type Mutation to type Mutation