Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev guideRecipesAPI ReferenceChangelog
Dev guideRecipesUser GuidesNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Fallback languages

How to ensure content availability across languages using automatic fallback logic.

Optimizely Graph supports automatic fallback when content is unavailable in the requested language. This ensures users still receive relevant content even if a translation is missing, improving reliability and user experience across multilingual applications.

Automatic fallback support in CMS

Fallback language support is built into Optimizely Graph for CMS 13 and SaaS CMS.

When a content item does not exist in the requested language, Optimizely Graph automatically returns the version in the configured fallback language. This prevents broken experiences and ensures content is always available.

Query with user-preferred language and fallback

Use this query to request content in a preferred language. If the requested locale is unavailable for a content item, Optimizely Graph falls back to the next configured language in your CMS settings.

query LocalizedContent(
  $locales: [Locales!]!
) {
  ArticlePage(
    locale: $locales  # Graph automatically falls back to configured fallback language in CMS
    orderBy: { StartPublish: DESC }
  ) {
    items {
      Name
      TeaserText
      StartPublish
      RelativePath
      Language {
        Name
        DisplayName
      }
    }
  }
}

The following are some example variables:

{
  "locales": ["en"]
}

This query prioritizes English content. If an article is not available in English, Optimizely Graph returns the version in the fallback language defined in your CMS configuration.

Conclusion

Fallback language support in Optimizely Graph helps maintain content continuity across locales. By configuring fallback chains in your CMS and using locale-aware queries, you ensure users always receive meaningful content, even when translations are incomplete.