A structure builder, or null/undefined if no structure should be returned. See StructureBuilder
// sanity.config.js
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {schemaTypes} from './schema'
export default defineConfig({
name: 'default',
title: 'My Cool Project',
projectId: 'my-project-id',
dataset: 'production',
plugins: [
structureTool({
structure: (S, context) => {
console.log(context) // returns { currentUser, dataset, projectId, schema, getClient, documentStore }
return S.documentTypeList('post')
},
})
],
schema: schemaTypes
})
Lets you configure how lists, documents, views, menus, and initial value templates are organized in the Sanity Studio’s structure-tool.