
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis sounds like a classic API perspective mismatch issue. Since Vision returns your documents but your client doesn't, and you've confirmed the documents are published, the most likely culprit is the API perspective setting.
If you're using API version v2025-02-19 or later, the default perspective changed from raw to published. This is a breaking change that catches many developers off guard.
Here's what's likely happening:
raw perspective by default (shows all documents including drafts)published perspectiveAdd the perspective parameter to your client queries:
const client = sanityClient({
projectId: 'your-project-id',
dataset: 'your-dataset',
apiVersion: '2025-02-19',
useCdn: false,
perspective: 'raw', // or 'previewDrafts' or 'published'
})Or set it per-query:
const result = await client.fetch(query, params, {
perspective: 'raw'
})If you're using an older API version string in your client config (like '2021-03-25'), try updating to the latest version and explicitly setting the perspective.
Since you've already ruled out many common issues, try these:
Check the actual API request: Open your browser's Network tab and inspect the actual API request being made. Look at the URL parameters - you should see ?perspective=published (or similar). Compare this to what Vision is using.
Test with Vision's perspective: In Vision, there's a perspective dropdown (usually in the top-right). Try switching it to published and see if your documents disappear. If they do, that confirms the perspective issue.
Verify document IDs: Use Vision with the raw perspective and check if your documents have drafts. prefixes. Even "published" documents might only exist as drafts if something went wrong during publishing:
*[_type == "yourType"] { _id, _type }Look for IDs like drafts.document-id vs document-id. If you only see the drafts. versions, that's your problem - they were never actually published, just saved as drafts.
Check for document-level permissions: If you're using custom access control, verify that your API token has read permissions for these specific documents.
Try a different API version: Temporarily set your client to use apiVersion: '2021-03-25' to see if the behavior changes (this version defaults to raw perspective).
Sanity uses perspectives to provide different views of your content. The published perspective only returns documents without the drafts. prefix, while raw returns everything. If there's any inconsistency in how your documents were published, or if you're comparing different perspectives, you'll see this exact symptom.
The fact that other document types work fine suggests this particular type might have publishing workflow issues or was created/modified in a way that affected its published state differently.
Add this to your client code and see if your documents appear:
const result = await client.fetch(
'*[_type == "yourType"]',
{},
{ perspective: 'raw' }
)If they show up with perspective: 'raw' but not with perspective: 'published', you've confirmed the issue - your documents exist only as drafts despite appearing published in the Studio.
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