4

How do you set up live preview for headless Craft CMS installs connected to Gatsby?

2

When you enter live preview in the cp, it's an iframe to the URL you've set up for that section, including a token=xxxxxxxx, you need to pass this along to your GraphQL (assuming that's what you use), to let it know it's not supposed to fetch data from the database.

Andrew Welch has a bit more info about it here: https://nystudio107.com/blog/headless-preview-in-craft-cms

As well as another question here (based on vue, so you probably need to change som stuff for Gatsby): Live preview using Vue.js

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.