babel-plugin-react-relay
babel-plugin-react-relay copied to clipboard
Documentation: webpack.babel and graphql-js
I add difficulties to make it work under these conditions:
- es6 webpack configuration file (webpack.babel.js)
- graphql-js as configuration option
getting the error: "Schema must be an instance of GraphQLSchema" (schemaSource was always equal to {}
in https://github.com/graphcool/graphql-config/blob/master/src/index.ts#L98)
I had to remove react-relay plugin from .babelrc:
{
"presets": [
"es2015",
"stage-0",
"react"
]
}
and put it back in webpack.babel.js, in the babel options of the webpack loader:
{
"presets": [
"es2015",
"stage-0",
"react"
],
"plugins": ["react-relay"]
}
Maybe it's obvious but it wasn't to me. It would ne nice to have this referenced somewhere.
Good point. Would you'd like to create a PR with these hints in the README?
I thought about it but… let's say I'm flattered that you didn't notice that my english skills are very low ^^.
No worries, just go for it. 👍
I'll make some tests with different configuration options to see if it's really related to grapqhl-js and "je me jette à l'eau" ;)