
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes, this is absolutely possible! Sanity does provide a GraphQL endpoint that you can use with Hasura's remote schemas feature.
First, you need to deploy a GraphQL API for your Sanity project. From your Sanity Studio project folder, run:
sanity graphql deployThis will generate and deploy a GraphQL endpoint based on your Sanity schema. Your endpoint URL will follow this format:
https://<yourProjectId>.api.sanity.io/v2023-08-01/graphql/<dataset>/<tag>
<yourProjectId> with your actual Sanity project ID<dataset> with your dataset name (usually production)<tag> defaults to default unless you specify otherwiseFor production use with high traffic, you can use the CDN-cached version:
https://<yourProjectId>.apicdn.sanity.io/v2023-08-01/graphql/<dataset>/<tag>
Once you have your GraphQL endpoint, you can add it as a remote schema in Hasura:
Schema Updates: Remember that when you change your Sanity schema, you need to redeploy the GraphQL API by running sanity graphql deploy again. The endpoint doesn't automatically update.
Read-Only: Sanity's GraphQL API is currently read-only for queries. Mutations aren't supported through GraphQL, so you'll need to use Sanity's Mutation API for write operations.
Schema Compatibility: Sanity requires stricter schema definitions for GraphQL than it does for GROQ. You may need to move any "anonymous" object types to named, top-level types in your schema.
This setup should work similarly to how Contentful integrates with Hasura, allowing you to query your Sanity content alongside your Hasura data in unified GraphQL queries.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store