strapi-plugin-preview-button
strapi-plugin-preview-button copied to clipboard
Does it work with plugin based on graphql ?
I'm using the gatsby-source-strapi
plugin to query the data in my Gatsby FE app.
This config makes the preview button show up in the Strapi CMS.
module.exports = ({ env }) => ({
'preview-button': {
config: {
contentTypes: [
{
uid: 'api::game.game',
draft: {
url: 'http://strapiurl:1337/api/preview',
query: {
type: 'game',
slug: '{slug}',
},
},
published: {
url: 'https://gatsbyurl/games/{slug}',
},
},
],
},
},
});
If i change the title for ex and i click the Preview button i don't see the new title.
Is this how it's supposed to work or is this because i'm using the gatsby-source-strapi
plugin?
Hi @muscaiu Your config looks correct 👍🏻 I wouldn't expect gatsby-source-strapi
to conflict with the preview button.
When you change the title
are you saving the entry before clicking the preview button? The plugin won't use the current values in the frontend fields, it only uses the data stored in the database.