gatsbyjs / wp-gatsby

WordPress plugin for gatsby-source-wordpress
Other
167 stars 41 forks source link

How do I get Gatsby to show changes when I reorder custom post types? #225

Closed indie-ridge-dev closed 2 years ago

indie-ridge-dev commented 2 years ago

When I change the order of custom post types using Post Types Order plugin the new order shows up in the WP GraphQL plugin.

When the reordering is finished I hook into the action provided by the plugin and run the following code $action_monitor = new \WPGatsby\ActionMonitor\ActionMonitor(); $this->monitor = new \WPGatsby\ActionMonitor\Monitors\PostTypeMonitor($action_monitor); $this->monitor->trigger_refetch_all ( [ 'title' => __( 'Post Type Reordered', 'WPGatsby' ), ] );

This performs a data update on gatsby cloud but the new order of the post type is not updated during the build. The only way I can apply the correct order is to trigger a manual build and clearing the cache.

Does anyone know what am I doing wrong here?