From 662059bf4fb81b05e7966b535bd5a9baeae2e3c8 Mon Sep 17 00:00:00 2001 From: Vladislav Martinets Date: Tue, 1 Nov 2016 01:10:29 +0200 Subject: [PATCH] updated dependencies and readme.md in relay-api example --- examples/relay-api/README.md | 9 +++++--- examples/relay-api/package.json | 33 +++++++++++++++++----------- examples/relay-api/public/index.html | 4 ++-- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/examples/relay-api/README.md b/examples/relay-api/README.md index fb42e0ad1..89e20e564 100644 --- a/examples/relay-api/README.md +++ b/examples/relay-api/README.md @@ -32,7 +32,7 @@ AUTH0_CLIENT_ID=AUTH0_CLIENT_SECRET AUTH0_CLIENT_SECRET=AUTH0_CLIENT_ID ``` -Finally, retrieve a JWT and send it to the `/graphql` endpoint as a header. +Finally, retrieve a JWT (be sure to provide JWT by adding value of the `id_token` in localStorage using your browser) and send it to the `/graphql` endpoint as a header. ```js // App.js @@ -47,6 +47,9 @@ Relay.injectNetworkLayer( }) ); ``` + +After that you can run development server by using `npm run dev` command. + --- A simple example of how to get started with @@ -177,8 +180,8 @@ ReactDOM.render( `public/index.html`: ```html - - + +
diff --git a/examples/relay-api/package.json b/examples/relay-api/package.json index e35b4c6c3..0e358a856 100644 --- a/examples/relay-api/package.json +++ b/examples/relay-api/package.json @@ -14,22 +14,25 @@ "author": "Michael Hart ", "license": "MIT", "dependencies": { - "dotenv": "^1.2.0", - "express": "^4.13.3", - "express-graphql": "^0.3.0", - "graphql": "^0.4.4", - "graphql-relay": "^0.3.2", - "react": "^0.14.0-rc1", - "react-dom": "^0.14.0-rc1", - "react-relay": "^0.3.2" + "dotenv": "^2.0.0", + "express": "^4.14", + "express-graphql": "^0.5.4", + "express-jwt": "^5.1.0", + "graphql": "^0.7.2", + "graphql-relay": "^0.4.3", + "react": "^15.3.2", + "react-dom": "^15.3.2", + "react-relay": "^0.9.3" }, "devDependencies": { - "babel-relay-plugin": "^0.2.5", - "babelify": "^6.3.0", - "browserify": "^11.1.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-react": "^6.11.1", + "babel-relay-plugin": "^0.9.3", + "babelify": "^7.3.0", + "browserify": "^13.1.1", "browserify-shim": "^3.8.10", "nodemon": "^1.5.1", - "onchange": "^2.0.0", + "onchange": "^3.0.2", "parallelshell": "^2.0.0" }, "browserify-shim": { @@ -42,6 +45,10 @@ [ "babelify", { + "presets": [ + "es2015", + "react" + ], "plugins": [ "./utils/babelRelayPlugin" ] @@ -56,7 +63,7 @@ "build": "npm run build:schema && npm run build:browser", "build:schema": "node ./utils/updateSchema.js", "build:browser": "browserify browser.js -o public/bundle.js", - "watch": "parallelshell 'npm run watch:schema' 'npm run watch:browser' 'npm run watch:server'", + "watch": "parallelshell \"npm run watch:schema\" \"npm run watch:browser\" \"npm run watch:server\"", "watch:schema": "onchange schema/schema.js -- npm run build:schema", "watch:browser": "onchange browser.js App.js schema/schema.json -- npm run build:browser", "watch:server": "nodemon --watch server.js --watch 'schema/*.js' server.js" diff --git a/examples/relay-api/public/index.html b/examples/relay-api/public/index.html index f79cea4bd..17b767a9c 100644 --- a/examples/relay-api/public/index.html +++ b/examples/relay-api/public/index.html @@ -1,6 +1,6 @@ - - + +