Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated dependencies and readme.md in relay-api example #140

Merged
merged 1 commit into from
Nov 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions examples/relay-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -177,8 +180,8 @@ ReactDOM.render(
`public/index.html`:
```html
<!-- include React and Relay scripts (we don't bundle them) -->
<script src=//fb.me/react-0.14.0-rc1.min.js></script>
<script src=//fb.me/react-dom-0.14.0-rc1.min.js></script>
<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js></script>
<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js></script>
<script src=/relay/relay.min.js></script>
<div id=content />
<!-- now request our browserified bundle which will run the React.render -->
Expand Down
33 changes: 20 additions & 13 deletions examples/relay-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,25 @@
"author": "Michael Hart <michael.hart.au@gmail.com>",
"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": {
Expand All @@ -42,6 +45,10 @@
[
"babelify",
{
"presets": [
"es2015",
"react"
],
"plugins": [
"./utils/babelRelayPlugin"
]
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions examples/relay-api/public/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- include React and Relay scripts (we don't bundle them) -->
<script src=//fb.me/react-0.14.0-rc1.min.js></script>
<script src=//fb.me/react-dom-0.14.0-rc1.min.js></script>
<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js></script>
<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js></script>
<script src=/relay/relay.min.js></script>
<div id=content />
<!-- now request our browserified bundle which will run the React.render -->
Expand Down