How do you set up live preview for headless Craft CMS installs connected to Gatsby?
Asked
Active
Viewed 1,639 times
1 Answers
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
peirix
- 431
- 4
- 23
-
How should I configure the frontend application url on craft? I'm trying to do this, but I didn't find a way so far. The frontend application is already looking for a token parameter to send it back on graphql requests. Could you help me on this? – William Luis Alberton Jul 22 '21 at 19:00