Filtered document lists showing error on load
I can see you're experiencing an issue with filtered document lists in Sanity Studio, but your question appears to have been cut off - you mentioned they're "showing this when loaded:" but didn't include what's actually being displayed. However, I can help you with the most likely culprit based on recent changes.
The most common cause right now is the API perspective change:
On February 24, 2025, Sanity released API version 2025-02-19 which includes a breaking change: the default perspective switched from raw to published. This means:
- Filtered document lists now only show published documents by default
- Draft documents (including those with
drafts.prefix) won't appear unless you explicitly set the perspective - If you were filtering for drafts or expecting unpublished content, your lists may now appear empty
To fix this in your Structure Tool configuration:
S.documentList()
.title("Your Filtered List")
.filter('_type == "yourType" && yourCondition')
.apiVersion('2024-01-01') // Use an older API versionOr if you want to see drafts with the new API version, you'll need to adjust your filter to account for the perspective change, or configure your Structure Tool to use perspective=raw or perspective=previewDrafts.
Other things to check:
- Browser console for error messages
- Whether your filter query references fields that might not exist on published documents
- If you're using query parameters (like
$today), ensure they're properly defined
Can you share what's actually displaying (error message, blank screen, empty list, etc.) so I can give you more specific guidance?
Show original thread5 replies
Sanity – Build the way you think, not the way your CMS thinks
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.