✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

How to Expose a Singleton Landing Page to the GraphQL API

2 replies
Last updated: Jun 12, 2020
Hey all, I've built a "singleton" for the landing page of a project, but It's not been exposed to the graphql api. Is there something I need to add to do so?
import S from "@sanity/desk-tool/structure-builder";

export default () =>
  S.list()
    .title("Content")
    .items([
      S.listItem()
        .title("Settings")
        .child(
          S.editor().schemaType("siteSettings").documentId("siteSettings")
        ),
      S.listItem()
        .title("Home Page")
        .child(S.editor().schemaType("index").documentId("index")),
      ...S.documentTypeListItems(),
    ]);

Jun 12, 2020, 4:08 AM
False alarm! Followed along with this blog post and got everything working as expected 🙂 https://www.frontendstumbles.com/creating-singleton-pages-with-sanity/
Jun 12, 2020, 4:49 AM
Awesome - that’s a good page to stumble upon 😉 Glad you got it sorted!
Jun 12, 2020, 8:10 AM

Sanity– build remarkable experiences at scale

Sanity is a modern 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?