We want to add the language fallback functionality to GraphQL but make it optional, i.e., it is NOT the default but there is a new field added to the schema that users can explicitly request for.
New field schema in SDL:
# ...
labelWithLanguageFallback(languageCode: LanguageCode!): LabelWithLanguage
}
type LabelWithLanguage {
languageCode: LanguageCode!
value: String!
}The user can ask for the label in a certain language and they get back a value and a language code. This language code is either the one they asked for if a label in that language exists, or the language code of the label it fell back to. If there weren't any labels for the languages in the fallback chain, it returns null.
This new field would go into any types that implement LabelProvider. Not sure about the name of the return type - LabelWithLanguage vs LabelInLanguage?