GraphQL integration
Sanity (GraphQL) GraphQL integration for Draftbit
Sanity Content Lake GraphQL API
What is Sanity (GraphQL)?
Sanity exposes a deployed GraphQL API per dataset. For public datasets no auth is needed; otherwise paste a viewer token.
Use Sanity (GraphQL) with Draftbit
- Schema discovered automatically via GraphQL introspection.
- Queries, mutations, and subscriptions usable across screens and AI agents.
- Auth headers configured once and reused for every operation.
- Works with custom Sanity (GraphQL) schemas and federated graphs.
Example
sanity-graphql-query.graphql # Example query against Sanity (GraphQL)
query GetItems {
items(limit: 10) {
id
name
createdAt
}
}Use cases
- Drive a blog, news feed, or content section from a headless CMS
- Let non-engineers publish app content without a release
- Localize copy and assets without code changes
Authentication
Add any required auth headers when you connect Sanity (GraphQL). Headers are stored per app and applied to every operation.
Use Sanity (GraphQL) in a Draftbit app today
Start free, connect Sanity (GraphQL) in minutes, and ship with AI agents that know how to use it.
Frequently asked questions
What is the Sanity (GraphQL) GraphQL integration?
Sanity exposes a deployed GraphQL API per dataset. For public datasets no auth is needed; otherwise paste a viewer token.
How do I connect Sanity (GraphQL) to a Draftbit app?
In your Draftbit app go to Integrations → GraphQL and choose Sanity (GraphQL). Provide the endpoint URL and any auth headers; Draftbit introspects the schema and exposes operations to your app and AI agents.
Do I need to write GraphQL queries by hand?
No — once Sanity (GraphQL)'s schema is introspected, Draftbit lets you bind components to operations visually, and AI agents can compose queries against the live schema.
What can I build with Sanity (GraphQL) and Draftbit?
Use Sanity (GraphQL) as a headless CMS for your app: Drive a blog, news feed, or content section from a headless CMS; Let non-engineers publish app content without a release.