
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes! It is possible to fetch draft content with the GraphQL API for previews. You can use the perspective query parameter to control which version of your content is returned.
To fetch draft content, add the perspective query parameter to your GraphQL endpoint. The available options are:
published (default): Returns only published documents, excluding draftspreviewDrafts: Prioritizes draft documents over published versions when both exist - this is what you want for previewsraw: Returns both drafts and published content side-by-side (requires authentication)releaseA,releaseB,published)For your resolveProductionUrl preview use case, you'd query the GraphQL API like this:
https://<yourProjectId>.apicdn.sanity.io/v2025-02-19/graphql/<dataset>/<tag>?perspective=previewDrafts
The previewDrafts perspective will return draft versions when they exist, falling back to published versions when no draft is available - perfect for preview environments where editors need to see their unpublished changes.
api.sanity.io) and API CDN (apicdn.sanity.io) endpointspublished perspectivedrafts. (e.g., drafts.post-123)This feature is available in GraphQL API version v2023-08-01 and later, including the current v2025-02-19.
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