https://github.com/zanettin/inferno-apollo-demo
Inferno data container for Apollo Client - code example
https://github.com/zanettin/inferno-apollo-demo
apollo-client incompose inferno inferno-js
Last synced: 3 months ago
JSON representation
Inferno data container for Apollo Client - code example
- Host: GitHub
- URL: https://github.com/zanettin/inferno-apollo-demo
- Owner: zanettin
- Created: 2017-02-16T16:55:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-29T18:20:02.000Z (about 8 years ago)
- Last Synced: 2023-08-11T00:22:27.134Z (about 2 years ago)
- Topics: apollo-client, incompose, inferno, inferno-js
- Language: JavaScript
- Size: 17.5 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Inferno-apollo example app
This app is a combination of the `swapi graphql api`, `create-inferno-app`, `inferno-apollo` and `incompose`.
To play around with this example start the client as well as the server. If everything works correctly, you should see a list of star wars movies.## Install
```
git clone git@github.com:zanettin/inferno-apollo-demo.git
cd inferno-apollo-demo
npm install
```## Start
Totally new to InfernoJS and/or graphQL? [Checkout my blog on medium](https://medium.com/@roman_zanettin/infernojs-meets-apollo-in-a-functional-way-15f1bebea34e#.c10ghd4dg)### server
```
npm run start:server
```
this command starts a node/express server on `localhost:4000`### frontend
```
npm start
```
this command starts a node server with live reload on `localhost:3000`## GraphiQL
This repo also contains the graphiQL interface to test your queries.
Just navigate to `localhost:4000` in your browser to find the interface.## Server settings
In `server/src/server/main.js` you'll find the node/express server.
I've defined a tiny timeout to ensure, that you'll see the loading indicator. If you like to remove this timeout, just change the code to:
```js
// POST requests to /graphql should be handled by middleware
app.post('/graphql', (req, res) => {
setCorsHeaders(res);
graphqlHTTP({
schema : swapiSchema,
graphiql : false,
})(req, res);
});
```## Links
- [inferno js](https://infernojs.org/)
- [incompose](https://github.com/zanettin/incompose)
- [inferno-apollo](https://github.com/zanettin/inferno-apollo)
- [create-inferno-app](https://github.com/infernojs/create-inferno-app)
- [swapi-graphql](https://github.com/graphql/swapi-graphql)
- [apollo client doc for react](http://dev.apollodata.com/react/queries.html)## Contribution / Questions
feel free to contribute or concat me [on twitter](https://twitter.com/roman_zanettin)