babel-plugin-react-relay icon indicating copy to clipboard operation
babel-plugin-react-relay copied to clipboard

Documentation: webpack.babel and graphql-js

Open cahnory opened this issue 8 years ago • 4 comments

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.

cahnory avatar Oct 04 '16 14:10 cahnory

Good point. Would you'd like to create a PR with these hints in the README?

schickling avatar Oct 04 '16 19:10 schickling

I thought about it but… let's say I'm flattered that you didn't notice that my english skills are very low ^^.

cahnory avatar Oct 05 '16 07:10 cahnory

No worries, just go for it. 👍

schickling avatar Oct 05 '16 12:10 schickling

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" ;)

cahnory avatar Oct 06 '16 08:10 cahnory