
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYour schema looks good! This defines an array field named contacts that will hold multiple items of type contact_person.
Here's what your schema does:
'contacts' - the field identifier used in queries and code'Contacts' - the human-readable label shown in Sanity Studio'array' - makes this an orderable collection[{ type: 'contact_person' }] - specifies that array items must be of type contact_personThe array field will automatically give you drag-and-drop reordering, and each item will get a unique _key property that Sanity uses to track items. You'll also get copy/paste functionality for free, letting editors copy individual contacts or entire arrays between documents.
Make sure you have a contact_person schema type defined elsewhere in your schema files. It could be either a document type or an object type, depending on whether you want contacts to be standalone documents (referenced) or embedded objects:
// As an embedded object (inline)
{
name: 'contact_person',
type: 'object',
fields: [
{ name: 'name', type: 'string' },
{ name: 'email', type: 'string' },
// ... other fields
]
}
// Or as a reference to a document
{
name: 'contacts',
type: 'array',
of: [
{
type: 'reference',
to: [{ type: 'contact_person' }]
}
]
}If you're getting a validation error about invalid "of" property, double-check that contact_person is properly defined and exported in your schema.
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