How do you set up live preview for headless Craft CMS installs connected to Gatsby?
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