New field in Sanity schema not appearing in GraphQL API

12 replies
Last updated: Jan 28, 2026
I added a new field in fields array in siteSettings document and updated it's value with studio. But the field is not available in graphQL API.
{ name: 'siteURL',
      type: 'url',
      title: 'Site URL',
      description: 'Provide URL for your website.'
    },
What could be the issue? I did close the process and rebuild the gatsby site after updating.

EDIT: Solved
AI Update

Great that you solved it! For anyone else running into this issue, here's what's likely happening:

When you add a new field to your Sanity schema, you need to redeploy your GraphQL endpoint by running:

sanity graphql deploy

This is a separate step from deploying your Studio or rebuilding your Gatsby site. The GraphQL API is generated from your schema, so every time you make schema changes (adding/removing fields, changing types, etc.), you need to redeploy it.

Why this matters for Gatsby:

The gatsby-source-sanity plugin works by first fetching the GraphQL Schema Definitions from Sanity's deployed GraphQL API, then streaming all accessible documents to Gatsby's in-memory datastore. Without redeploying the GraphQL API, the plugin won't know about your new field.

Common workflow when adding new fields:

  1. Add the field to your schema (like your siteURL field)
  2. Run sanity graphql deploy from your Studio directory
  3. Update content in Studio
  4. Rebuild your Gatsby site

Pro tip: You can use sanity graphql deploy --dry-run to validate your schema changes before deploying, which will catch any breaking changes without actually deploying.

Note: While gatsby-source-sanity uses the deployed GraphQL API for schema definitions, Sanity also supports querying directly with GROQ if you prefer that approach. But if you're using the standard GraphQL setup with Gatsby, the sanity graphql deploy step is essential after schema changes.

Show original thread
12 replies

Sanity – Build the way you think, not the way your CMS thinks

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.

Was this answer helpful?