How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Difference between object type and document type in Sanity

3 repliesLast updated: Nov 29, 2025

What's the difference between
object
type and
document
type
AI Update

The main difference between object and document types in Sanity comes down to whether they can exist as standalone content in your Content Lake:

Document types are top-level content entries that:

Object types are reusable data structures that:

Think of it this way: documents are the "main content" you create and manage, while objects are the "components" or "building blocks" you use to structure that content.

Here's a practical example from the Object Types documentation:

// Document type - appears in Studio sidebar
{
  name: 'blogPost',
  type: 'document',
  fields: [
    {name: 'title', type: 'string'},
    {name: 'author', type: 'authorInfo'} // uses object below
  ]
}

// Object type - reusable component
{
  name: 'authorInfo',
  type: 'object',
  fields: [
    {name: 'name', type: 'string'},
    {name: 'bio', type: 'text'}
  ]
}

One important note: If you're using GraphQL, you should avoid anonymous inline objects and instead define named object types at the top level of your schema, as GraphQL requires all nested structures to be explicitly defined types.

Show original thread
3 replies

Was this answer helpful?

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.

Related contributions