Hi!
I'm trying to configure Prismic previews in a Gatsby project with the gatsby-plugin-prismic-previews
.
Previewing published content works well. Also previewing completely new content that is unpublished works well (it will use the 404 page and the HOC withPrismicUnpublishedPreview
to resolve this).
The one issue we have is when updating an existing document that is already live and published. Then you will have some draft changes that are unpublished.
When trying to preview that document it will launch the preview and display the original document that is the one that is already live.
How is the plugin suppose to detect that we have some draft changes and display that instead?
It is key to be able to preview changes that you are about to publish. So I assume we are missing something in the configuration.
We use a very simple setup in the gatsby-browser.js
.
<PrismicPreviewProvider
repositoryConfigs={[
{
repositoryName: "our_repo_name",
linkResolver,
componentResolver: componentResolverFromMap({
post: PostTemplate,
}),
},
]}
>
{element}
</PrismicPreviewProvider>
And minimum options in gatsby-config.js
.
{
resolve: "gatsby-plugin-prismic-previews",
options: {
repositoryName: "our_repo_name",
accessToken: "the_access_token",
},
},
I mean the integration seems to work well except for the use case I described.