How to define schema for deskStructure in

5 replies
Last updated: May 17, 2020
Hi everyone.I'm following the guide I've added Site settings and restarted/recompiled the studio.
import S from '@sanity/desk-tool/structure-builder';

export default () =>
                .title(`Site settings`)
            // Add visual divider
                    .filter( listItem => ![`siteSettings`].includes(listItem.getId() ))
However, when I click on the 'Site Settings' I get the following error:

Unknown schema type
This document has the schema type 
, which is not defined as a type in the local content studio schema.

Where do I define the schema for the deskStructure?
May 16, 2020, 9:16 PM
Hi Jan, have you defined the schema itself for
? Depending on your folder structure, you might have a
file in your
folder with the the appropriate contents. Once this file is in place, you will have to add it to your
import siteSettings from './documents/siteSettings'
export default createSchema({
  types: schemaTypes.concat([
Full examples here:
May 16, 2020, 9:23 PM
Hey, thanks for giving me hints. No, I didn't make the schema, but I wasn't quite sure, how to go about it. I shall read through the links you sent me. Cheers.
May 16, 2020, 9:25 PM
Yep, that did the trick! I sort of knew, I needed to define the schema, but I didn't work out how, where to add it, etc. Now it makes so much more sense and it seems obvious. One could even say… sane! (pun intended). Thank you.
May 16, 2020, 9:39 PM
Glad no sanity was lost in the process 😄 If you’re interested, there’s some more information on schemas in this guide for example:
May 16, 2020, 10:47 PM
Thanks, yes this mini series of short vids is really good. That's what actually got me started in the first place.
May 17, 2020, 9:05 AM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?