I have a document type page
which contains an array of blocks
that are the references to other object types. When i fetch the data for page
document, it returns draft data for document but not for the references that are in array.
I have written query like this which returns me both drafts and non-drafts data for document:
*[_type == "page" && slug.current == "${querySlug === '/' ? 'home' : querySlug}"] {
_id,
title,
description,
showSubNav,
subNavigation[] -> {slug, title},
blocks[] -> {
...,
heroCardBlock -> {...},
oneColumnContent -> {...},
featuredNews -> {...},
newsCategories[] -> {...},
newsList[] -> {..., selectedCategory -> {...}},
caseStudiesListSource[] -> {...},
}
}
This returns drafts and non-drafts data for page
document and drafts are available for non-referenced blocks e.g title, description, showSubNav etc but for subNavigation and blocks array which are array of references to other object types, draft data is not being returned only published data is returned in query.
My sanity desk structure is like this: Sanity Desk Structure
How can i get draft data for these references?