
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGreat question! This is a common point of confusion when starting with Gatsby and Sanity. What you're experiencing is expected behavior for a static site generator like Gatsby, but there are several ways to get more dynamic updates.
Gatsby generates static HTML files at build time (SSG - Static Site Generation). When you run gatsby build, it fetches all your content from Sanity and creates static pages. Once built, those pages don't automatically know about content changes in Sanity - that's why you need to rebuild to see updates.
This is different from Next.js's Incremental Static Regeneration (ISR), which can automatically rebuild pages on-demand. Gatsby doesn't have true ISR in the same way, though it does support incremental builds.
During development, you can see changes in real-time! The gatsby-source-sanity plugin supports watchMode which pushes changes from Sanity to Gatsby instantly:
// gatsby-config.js
{
resolve: 'gatsby-source-sanity',
options: {
projectId: 'your-project-id',
dataset: 'production',
watchMode: true, // Enable real-time updates in dev
overlayDrafts: true, // See draft content
token: process.env.SANITY_TOKEN // Required for drafts
}
}When you run gatsby develop, changes in Sanity Studio will appear immediately without restarting.
For production, set up webhooks to trigger automatic rebuilds when content changes:
If you host on Gatsby Cloud, it supports incremental builds that only rebuild changed pages, making updates much faster than full rebuilds.
For pages that need real-time data, Gatsby 4+ supports SSR using getServerData. These pages fetch fresh data on every request, but this requires server hosting (not static hosting).
Gatsby also has Deferred Static Generation (DSG) which generates pages on-first-request, but once generated, they're still static until the next build.
For most Sanity + Gatsby projects:
watchMode: true for instant previewoverlayDrafts: true to preview unpublished content during developmentThis gives you a great editing experience while maintaining the performance benefits of static sites!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store