Localized Content from the Query API

Localized content requires special handling from the API. There are two methods for requesting localized content. When nothing is passed in, the default language is returned. Feel free to query along with the following API. https://api-euwest.graphcms.com/v1/cjr6hhs897w5p01eqpai0kkqa/master

Passing in a query argument

You can pass a locale argument to a field on a model. See the example below.

robots {
greeting(locale: RB)

Requesting Multiple Languages

Sometimes you will want to access all the languages, and in those cases you can simply ask for the data explicitly.

# Using Aliases
rb: robots {
greeting(locale: RB)
en: robots {
greeting(locale: EN)

Passing a header flag

You can query for the content by passing in a gcms-locale header. This header takes a comma separated list of locales. If the content of that first specified locale in the list would return null, the next locale will be checked and so on until one of these contains content. If all of the specified locales return null, the default locale will be checked.

To disbale that default value check, you can use the gcms-locale-no-default header. This boolean header is set to false as default. To enable it, pass gcms-locale-no-default: true.

Here's an example of setting a header with the web standard, fetch.

fetch("https://api-euwest.graphcms.com/v1/cjr6hhs897w5p01eqpai0kkqa/master", {
method: 'post',
headers: {
"gcms-locale": "RB, DE, EN",
"gcms-locale-no-default": true,
"Content-Type": "application/json"
body: '{"query": "{ robots { greeting } }"}'
.then(res => res.json())
.then(data => {
.catch(function (error) {

Mutating Localized Content

The individual fields contain a localized prefix and mutation occurs by posting content into the relevant fields. Here's an example of creating a new Robot.

mutation {
greetingEN: "Hello Humanoid!"
greetingRB: "Bipp Bipp Bopp!"
}) {