gatsbyjs/gatsby-source-wordpress-experimental

Custom GraphQL schema value not update on gatsby

Closed this issue · 1 comments

Hi I just wondering if this is problem with the plugin or not. I have write custom GraphQL schema to work with the Theme customizer in Wordpress. I Test on Gatsby I can get the value from the text box by query in GraphQL it work fine. but when I change the value from Wordpress and run query again the value still the same. it's not automatically update. to see an update value I have to stop and run gatsby develop again and the value will change.

Screen Shot 2020-11-13 at 16 28 09

do you have any ideas? or is this a bug?

Hi @tibeemts this is because Gatsby is essentially a caching layer. So we need to send an event from WP to Gatsby saying to re-fetch that piece of data.
Doing delta updates on non-node data is currently not implemented. Follow #209 for updates there 👍 .

We're currently planning on adding an event when options are changed which will trigger Gatsby to re-fetch non-node data (such as what's in your screenshot).