Relay / GraphQL Schema Cache Does Not Refresh When Updating a Server-Side Schema

I have a React application using Relay and a remote GraphQL server. When I start the webpack server, I get the latest circuit and pass it to the babel-relay-plugin plugin.

It works fine ... unless I make a circuit change. React or Relay or webpack appears, or something caches the scheme, because I get the error of checking the scheme in the browser console when the application starts. However, when I run the query manually against the GraphQL server using GraphIQL, the query succeeds. So it had to be some kind of cache on the reaction side, the relay, the webpack that I think of?

Things I tried:

  • List item
  • Web page server restart
  • Removing node_modules and npm install
  • I even tried restarting my computer (which actually worked, but may be a coincidence)

Thanks in advance for your help.

+8
caching reactjs relayjs graphql-js
source share
2 answers

It turns out, of course, that it was a human error. I had cacheDirectory as true in my babel bootloader request. You can read about it in the readme for babel-loader (just search the page for 'cacheDirectory') https://github.com/babel/babel-loader

As soon as I changed it to false , which is the default. The problem is gone. Hope that helps others.

+5
source share

This happened to me when I switched to Webpack 2.

The solution in my case was to move babelRelayPlugin as the first plugin to execute in .babelrc .

I'm not quite sure why.

+3
source share

All Articles