Skip to content

Can't find i18n fields in GraphQL after deploying document-internationalization plugin

58repliesLast updated: Nov 17, 2026

Hello Sanity team, I am trying to use the document-internationalization plugin which works well with GROQ but I am struggling to follow the GraphQL doc (https://github.com/sanity-io/document-internationalization/blob/main/docs/graphql-intl-doc.md ). I can edit the document but once deployed, I can’t find any i18_* field. Would you have any example please? Many thanks!
AI Update

GraphQL only exposes fields that are declared in your Studio schema and included in the deployed GraphQL API. So the i18n_* fields (or, with today's plugin, the language field) have to be defined on each translatable document type. After any schema change, run the GraphQL deploy again.

If you're on the legacy i18n_* setup (Studio v2)

The old document-internationalization setup stored hidden i18n_lang, i18n_base and i18n_refs fields on each translated document. They won't appear in GraphQL unless:

{ name: 'i18n_lang', type: 'string', hidden: true },
{ name: 'i18n_base', type: 'reference', hidden: true, to: [{ type: 'page' }] },
{
  name: 'i18n_refs',
  type: 'array',
  hidden: true,
  of: [{ type: 'reference', to: [{ type: 'page' }] }],
},

Check what the base field actually holds in your documents (a single reference or an array) and match the schema to it. If they don't match, GraphQL returns null.

That setup is for Studio v2. On a current Studio, use the plugin model below.

Current approach: @sanity/document-internationalization

With today's plugin, each language is its own document. The plugin sets a language field on each document and creates a translation.metadata document that references all the language versions (Localization docs). No i18n_* fields are involved.

npx sanity@latest graphql deploy
query {
  allPage(where: { language: { eq: "en" } }) {
    _id
    title
    language
  }
}

Some GraphQL limits to know about: string fields support eq, neq, in, nin and matches, but arrays can't be filtered. So you can't filter on a list of translation references, only on scalar fields like language. The legacy v1 endpoint still works, but dated endpoints like https://<projectId>.api.sanity.io/v2025-02-19/graphql/<dataset>/<tag> are current.

Getting the other translations of a document

The documented way is GROQ. Go from a document to its translation.metadata and follow the references:

*[_type == "page" && language == $language]{
  title, slug, language,
  "_translations": *[_type == "translation.metadata" && references(^._id)].translations[].value->{
    title, slug, language
  }
}

According to the Sanity docs, the plugin's README has both GROQ and GraphQL query examples. Check it for the GraphQL version of this lookup for your plugin version.

Also note: v6 of the plugin moved the language identifier in the metadata translation entries from _key to a dedicated language field. If you upgrade, update any queries that filter on _key.

Show original thread
58 replies

Was this answer helpful?

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.

Related contributions