Browse Sanity raw data without schema in Studio
Absolutely! You have several great options for browsing raw data in your Sanity instance without needing a schema defined in Studio:
Vision Tool (Built into Studio)
The easiest option is the Vision tool, which comes preinstalled with Sanity Studio. You can access it from the Studio toolbar and it lets you query your entire dataset using GROQ, regardless of whether you have schemas defined. Since it uses your authenticated Studio credentials, you'll see everything including drafts and documents without schemas.
To use it for your situation, try these queries:
// See all document types in your dataset
*[]{_type} | order(_type asc)
// Find documents referencing a specific document
*[references("your-document-id")]
// Browse all documents of a specific type
*[_type == "yourType"]Vision is perfect for exploring your data and finding those old references before you delete documents.
groq.dev Playground
If you want to query outside of Studio, you can use groq.dev, a browser-based GROQ playground. You'll need to authenticate with your Sanity project to access your actual data. This gives you a clean interface without needing Studio running.
Sanity CLI
The Sanity CLI offers powerful data access:
# Query documents directly from terminal
sanity documents query '*[_type == "yourType"]'
# Export entire dataset as NDJSON
sanity dataset export production backup.ndjson
# List all documents
sanity documents listThe export option is particularly useful for your use case - you can export everything to a file and search through it to find those references.
HTTP API
You can also query directly via the HTTP API using curl or any HTTP client:
curl "https://YOUR-PROJECT-ID.api.sanity.io/v2021-10-21/data/query/production?query=*"For your specific situation of finding old references before deleting documents, I'd recommend starting with Vision in Studio - it's the quickest way to run queries like *[references("doc-id")] to track down what's pointing to your documents. The references() function is specifically designed to find these cross-document relationships, which sounds exactly like what you need to clean up your dataset.
Show original thread7 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.