I have a React app using Relay and a remote GraphQL server. When I start the webpack server, I have it fetch the latest schema and feed it into the babel-relay-plugin.
It works great....except when I make a schema change. It appears React or Relay or webpack or something is caching the schema, because I'll get a Schema validation error in the browser console when I run the app. However, when I run the query manually against the GraphQL server using GraphIQL, the query is successful. So it would have to be some sort of cache on the react, relay, webpack side I'm thinking?
Things I've tried:
node_modules
and npm install
Thanks in advance for your help.
Turns out, of course, it was human error. I had cacheDirectory as true
in my babel-loader query. You can read about it on the babel-loader readme (just do a find on page for 'cacheDirectory') https://github.com/babel/babel-loader
Once I changed that to false
, which is the default. The problem went away. Hope that helps others.
This happened to me when I switched to Webpack 2.
The solution in my case was to move the babelRelayPlugin
to be the first plugin to execute in .babelrc
.
I'm not exactly sure on the why though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With