Issue with using the document-internationalization plugin in Sanity and troubleshooting steps.
I can see you're having trouble finding the i18n_* fields in your GraphQL API after deploying. The issue is that the GraphQL documentation file you're referencing no longer exists in the plugin repository – it returns a 404 error, which explains why you're struggling to follow it.
Here's what's actually happening with the document-internationalization plugin and GraphQL:
How the Plugin Actually Works
The plugin uses a metadata document approach. When you create translations:
- Your content documents (like a
lessondocument) remain as separate documents for each language - A special
translation.metadatadocument is created that links all the language versions together - Each content document gets a
languagefield (or whatever you configure vialanguageField)
The __i18n_lang, __i18n_base, and __i18n_refs fields are internal metadata fields that exist on the translation.metadata document type, not directly on your content documents.
The GraphQL Challenge
The plugin was primarily designed for GROQ queries, and GraphQL support has significant limitations. The metadata document structure doesn't expose these internal fields in a straightforward way through GraphQL.
Recommended Solutions
Option 1: Use GROQ (Recommended)
Since you mentioned GROQ works well, stick with it. You can query by the language field on your documents:
*[_type == "lesson" && language == "en"]Option 2: Query via the language field in GraphQL
Your content documents should have a language field that you can query in GraphQL:
query {
allLesson(where: { language: { eq: "en" } }) {
_id
title
language
}
}Make sure you've run sanity graphql deploy after adding the plugin.
Option 3: Check the Sanity Community
The original community thread you may have seen discusses these exact limitations. The missing documentation suggests GraphQL isn't a fully supported path for this plugin.
The key takeaway: the plugin's GraphQL support is limited by design. The internal i18n_* fields aren't meant to be directly queried through GraphQL – instead, use the language field on your content documents to filter by language.
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.