Closed MobyDigg closed 11 months ago
@jasonbahl do you have any idea, what this might be?
@MobyDigg are you using the Classic Editor or Gutenberg?
If you're using Gutenberg with Advanced Custom Fields, there's currently a core Gutenberg issue that prevents meta from being previewed, even in non-headless WordPress. See: https://github.com/WordPress/gutenberg/issues/16006#issuecomment-657965028
@jasonbahl I disabled Gutenberg through the plugin "Disable Gutenberg". Does that create a problem?
@MobyDigg hard to say.
Can you test your query in the GraphiQL IDE in the WP-Admin and see if you can query the flex field data properly for a preview post?
You can replicate in WordPress like so:
{
post(id: 1427, idType: DATABASE_ID, asPreview: false) {
...PostFields
}
preview: post(id: 1427, idType: DATABASE_ID, asPreview: true) {
...PostFields
}
}
fragment PostFields on Post {
id
title
status
flexTestYo {
flexTest {
... on Post_Flextestyo_FlexTest_Somethings {
textBox
}
}
}
}
You can see I'm able to see my published value "test" in my flex field, and the "preview" value when I query the post as a preview.
From what I can tell, things are working fine in WPGraphQL with previewing flex fields while using the classic editor.
If you're also able to see your preview data in WPGraphQL directly, but not in Gatsby, then I would think this is either a WPGatsby bug or a Gatsby Source WordPress bug.
If you're not able to see the preview data directly in WPGraphQL, then perhaps there is indeed something more we need to look into on this side of things.
Closing as there's not been a reply since my last attempt to reproduce.
Problem:
The preview of the gatsby-source-wordpress isn't updating for flexible content elements.
My preview works for regular ACF fields or all other WordPress fields. The issue is, when I update a flexible content layout. Although the preview is produced and displays normally, it doesn't show the updated fields of the flexible content layout – just the old, published content.
Testing
Errors
The following error is displayed in the terminal output:
What I tried
Conditional chaining in all respective files
wp-config.php has no line such as
define( 'WP_POST_REVISIONS', FALSE );
gatsby-node.js query for
allWpContentNode
has no filters and no sorting going on:Page query reads as follows:
Setup
Question
Is there anything I should setup to make changes in flexible content types available in the preview?
Note
I did not know where to post this, so there is the same issue here: https://github.com/gatsbyjs/gatsby/issues/29570