Dev Mode
List all schemas in development
By Ollie Taylor
structure.js
import S from "@sanity/desk-tool/structure-builder";
const structureListAll = S.listItem()
.title("All Document Types")
.child(
S.list()
.title("All Types")
.items([
/* This returns an array of all the document types defined in the schema.*/
...S.documentTypeListItems(),
]),
);
export default () =>
S.list()
.title("Content Management")
.items([
//...YOUR STRUCTURE
process.env.NODE_ENV === "development" ? structureListAll : S.divider(),
]);
This snippet will list all your schema types in your studio. This can be great for debugging in development.
You can leave this snippet in when you deploy as it will not render in production.
Contributor

Ollie Taylor
A multidimensional designer with a healthy obsession for code