Headless Server Developer Manual / Version 2207
Table Of ContentsLocalized variants of any content object can be obtained using either the field localizedVariants or localizedVariant. The first will return all existing variants of a content object while the latter requires specific locale parameters in order to retrieve the variant of a specific variant.
query LocalizedVariants($path: String!) { content { pageByPath(path: $path) { title type localizedVariants { ... on CMChannel { repositoryPath locale } } localizedVariant(language: "en", country: "us", variant: "") { ... on CMChannel { repositoryPath locale } } } } }
With the locale specific approach, the parameter language is mandatory, while country and variant are optional. Please note, that if a given combination of locale parameters does not exist you may get an empty object. When skipping the parameter country however, the first variant matching the language will be returned.