
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on the context of your question, I believe you're asking whether the list property on a string field (which defines dropdown/select options) can be a promise or async function.
No, the list property cannot be a promise. The list property in Sanity schema definitions must be either:
defineField({
name: 'category',
type: 'string',
options: {
list: ['news', 'blog', 'tutorial']
// or
// list: [
// {title: 'News', value: 'news'},
// {title: 'Blog', value: 'blog'}
// ]
}
})defineField({
name: 'category',
type: 'string',
options: {
list: () => ['news', 'blog', 'tutorial']
}
})The schema definition in Sanity is evaluated synchronously when Studio loads, so promises and async functions aren't supported in the list property.
Workarounds for dynamic options:
If you need to load options dynamically from an API or database, you have a few alternatives:
reference field instead of a string listThe custom input component approach gives you the most flexibility - you can fetch data when the component mounts and present it to users while still storing the value as a string field.
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