Almost EVERYONE who tried headless systems said they saw benefits. Download the state of CMS now!

Storyblok now on AWS Marketplace: Read more

O’Reilly Report: Decoupled Applications and Composable Web Architectures - Download Now

Empower your teams & get a 582% ROI: See Storyblok's CMS in action

Skip to main content

Querying multi-language content with the GraphQL API

  • FAQ
  • Querying multi-language content with the GraphQL Api

If you want to get field-level translations in our GraphQL Api, you have to query the language directly on the field. See the result by copying the following code snippets into our GraphQL Explorer example.

        
      {
  Space {
    languageCodes
  }
  PageItems(starts_with: "es/*") {
    items {
      lang
      content {
        body
        option(language: "es") {
          lang
        }
      }
    }
  }
}

    

Use the starts_with parameter on the top level and language on stories that are referenced through option fields.

        
      {
  PageItem(id: "es/about") {
    id
    lang
    name
    content {
      option(language: "es") {
        lang
      }
      body
    }
  }
}

    

For a specific content item, you need to prepend the language on the id and use the language parameter on referenced stories.