Issue with GraphQL API deployment causing build failure
Welcome to Sanity! Don't worry, this is a common issue that's easy to fix.
The error you're seeing is because your build process is being blocked by an interactive prompt asking you to confirm "breaking changes" in your GraphQL schema. The changes aren't actually dangerous in your case—when you ran sanity upgrade, it updated your schema in a way that made some fields nullable (changed from ID! to ID, String! to String, etc.).
Since you're deploying in an automated environment (like Netlify or another CI/CD platform), the build process can't respond to interactive prompts, so it times out and fails.
The Solution
Use the --force flag to bypass the confirmation prompt:
sanity graphql deploy --playground --forceUpdate your build script in package.json to:
{
"scripts": {
"graphql-deploy": "sanity graphql deploy --playground --force"
}
}The --force flag tells Sanity to deploy the GraphQL API without asking for confirmation about breaking changes. This is perfectly safe in your situation since you're just getting started and don't have existing GraphQL queries that would break.
Why This Happened
When you ran sanity upgrade, it updated your Sanity packages to newer versions that changed how certain system fields are typed in GraphQL. The CLI detected these as "breaking changes" because existing GraphQL queries might theoretically be affected, but in practice, these changes (making fields nullable instead of required) rarely cause actual issues.
Other Useful Flags
While you're at it, here are some other helpful flags for the sanity graphql deploy command:
--dataset <name>- Deploy to a specific dataset--tag <tag>- Deploy to a specific tag (defaults to 'default')--no-playground- Deploy without the public GraphQL playground--dry-run- Test the deployment without actually deploying
Good luck with your first Sanity project! 🎉
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.