The graphQL queries with fallbackLocales are great!
But there is an important information missing. If an item is found due to fallback, the locale in question should also be output.
Usecase
The project has three languages, EN, IT, DE. One item is only available in IT. The query with fallbackLocales
returns the Italian post and its Italian slug, almost perfect
query MyQuery {
allStories(locale: en, fallbackLocales: [en, it, de]) {
title
slug
}
}
But in this usecase we also need to provide a URL like this /it/italian-item-slug
. Damn, the locale is missing for this
Feature request
Output something like “_currentLocale” for the found item.
query MyQueryWithCurrentLocale {
allStories(locale: en, fallbackLocales: [en, it, de]) {
_currentLocale
title
slug
}
}
Would that be possible?