
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeArrays with multiple types are absolutely possible in Sanity! This is actually one of the powerful features of array fields. Without seeing your specific error, here are the most common issues and how to fix them:
Arrays with multiple types should look like this:
{
name: 'myArray',
type: 'array',
of: [
{type: 'block'},
{type: 'image'},
{type: 'reference', to: [{type: 'author'}]}
]
}1. Invalid "of" property
The array type requires a valid "of" property that defines what types can be included. Make sure you have:
of array (not type directly)of2. Type name conflicts
If you're defining inline object types within your array, their name properties shouldn't conflict with:
For example, this would cause an error:
// â Bad - 'callout' conflicts with a global type
of: [
{
name: 'callout', // If you have a global 'callout' type
type: 'object',
fields: [...]
}
]3. Missing required properties
Each item in the of array needs at minimum a type property. If you're using references, they also need a valid to property configured correctly.
Here's a complete example that mixes different types:
{
name: 'resourceItems',
type: 'array',
of: [
{
type: 'reference',
to: [{type: 'blogPost'}]
},
{
type: 'reference',
to: [{type: 'video'}]
},
{
type: 'object',
name: 'customNote',
fields: [
{name: 'text', type: 'string'}
]
}
]
}If you share the specific error message you're seeing, I can help pinpoint the exact issue! The error message usually gives good hints about what's wrong with the schema configuration.
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