# General Translation Integrations: Querying translations URL: https://generaltranslation.com/en-GB/docs/integrations/sanity/guides/querying-translations.mdx --- title: Querying translations description: How to query translated Sanity documents with GROQ using the General Translation document-level localisation model. related: links: - /docs/integrations/sanity/guides/translating-content - /docs/integrations/sanity/guides/managing-translations - /docs/integrations/sanity/guides/configuring-sanity --- General Translation stores Sanity translations as separate documents, each tagged with a language field (default `language`). Query the version you need by filtering on that field. Your existing source-language queries keep working. ## Query source content [#query-source] Source documents do not set the language field by default, so existing source queries need no changes. ```text *[_type == "article"]{ title, slug, body } ``` ## Query a target locale [#query-locale] Filter by the language field. ```text *[_type == "article" && language == "es"]{ title, slug, body } ``` ## Query a translated document [#query-one] ```text *[_type == "article" && slug.current == "hello-world" && language == "es"][0]{ title, body } ``` If you dedupe translated slugs, the slug includes the locale suffix, such as `hello-world-es`. ## Query all language versions [#query-all] ```text *[_type == "article"]{ title, slug, body, language } ``` ## Query source and translations together [#query-both] Because source documents may not define the language field, include both the source locale and undefined values. ```text *[_type == "article" && (language == "en" || !defined(language))]{ title, slug, body } ``` ## Use a custom language field [#custom-field] If your plugin config sets `languageField: 'locale'`, query `locale` instead of `language`. The schema field and the query field must match the configured value. ```text *[_type == "article" && locale == "es"]{ title, slug, body } ``` ## Query translated references [#query-references] After references are patched, translated documents point to the translated versions of referenced documents. Query them as you normally would. ```text *[_type == "article" && language == "es"]{ title, "author": author->{ name, language } } ``` See [Patch references](/docs/integrations/sanity/guides/managing-translations#patch-references) for how references are rewritten. ## Next steps - /docs/integrations/sanity/guides/translating-content - /docs/integrations/sanity/guides/managing-translations - /docs/integrations/sanity/guides/configuring-sanity