Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work with plugin based on graphql ? #114

Open
muscaiu opened this issue Oct 20, 2023 · 1 comment
Open

Does it work with plugin based on graphql ? #114

muscaiu opened this issue Oct 20, 2023 · 1 comment

Comments

@muscaiu
Copy link

muscaiu commented Oct 20, 2023

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}',
          },
        },
      ],
    },
  },
});
Screenshot 2023-10-20 at 21 34 43

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?

@mattmilburn
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants