
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes! You can absolutely reference documents in draft mode from other draft documents using weak references. This is exactly the use case weak references were designed for.
By default, Sanity uses "strong" references that only point to published documents. When you try to reference a draft document with a standard reference, you'll get validation errors on auto-save because the published version doesn't exist yet.
weak: true to Your Reference FieldIn your schema definition, modify your reference field to include weak: true:
{
name: 'parentPage',
type: 'reference',
to: [{type: 'page'}],
weak: true // This allows referencing draft documents
}This tells Sanity that the reference doesn't need to point to a published document, so you can reference drafts without errors.
This is perfect for your sub-page/parent structure where you want to create child pages that reference a parent page that's still in draft mode.
If you're creating documents through mutations or the client API, use _weak (with an underscore) instead:
{
_type: 'reference',
_ref: 'parent-document-id',
_weak: true
}When setting initial values that include references to drafts, make sure to include _weak: true in the reference object.
When querying with GROQ, the standard -> dereferencing operator only fetches published documents. If you need to retrieve draft versions of weakly-referenced documents, you may need to write custom queries that handle both drafts.* and published IDs.
Weak references give you the workflow flexibility to build interconnected content structures without forcing a specific publishing order, which is exactly what you need for your parent/sub-page hierarchy! You can read more about this in the Sanity reference type documentation.
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