Skip to content

Commit

Permalink
add relay example
Browse files Browse the repository at this point in the history
  • Loading branch information
smmoosavi committed Mar 13, 2017
1 parent b2427a4 commit 56c90ec
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Expand Up @@ -98,13 +98,36 @@ module.exports = function (webpackConfig, isDevelopment) {
};
```
related issues: [#107][107], [#167][167], [#214][214], [#309][309], [#411][411], [#1357][1357]

### Relay support
- install `babel-relay-plugin`:
```
npm install --save-dev babel-relay-plugin
```
- add `relayPlugin.js` file:
```js
const getBabelRelayPlugin = require('babel-relay-plugin');
const schemaData = require('./graphql.schema.json');
const relayPlugin = getBabelRelayPlugin(schemaData.data);
module.exports = relayPlugin;
```
- edit `webpack.monkey.js` like this:
```js
/* copy findLoader, addBabelPlugins from decorator example */
module.exports = function (webpackConfig, isDevelopment) {
addBabelPlugins(webpackConfig, [
require.resolve('./relayPlugin.js')
]);
};
```
related issues: [#462][462], [#662][662], [#900][900]
## TODOs
- [ ] add helpers
- [ ] customize test runner (jest)
- [ ] add more example
- [ ] scss support
- [x] decorator support
- [ ] relay support
- [x] relay support

## Thanks
@svrcekmichal for [configurable-react-scripts][configurable-react-scripts]
Expand All @@ -119,3 +142,7 @@ related issues: [#107][107], [#167][167], [#214][214], [#309][309], [#411][411],
[309]: https://github.com/facebookincubator/create-react-app/issues/309
[411]: https://github.com/facebookincubator/create-react-app/issues/411
[1357]: https://github.com/facebookincubator/create-react-app/issues/1357

[462]: https://github.com/facebookincubator/create-react-app/issues/462
[662]: https://github.com/facebookincubator/create-react-app/pull/662
[900]: https://github.com/facebookincubator/create-react-app/issues/900

0 comments on commit 56c90ec

Please sign in to comment.