Moved from GitHub dgraph/3801
Posted by vilarfg:
Experience Report
What you wanted to do
When I write a query using the @lang
directive, I don’t receive info on the locale of the result.
Example query:
{
q(func: allofterms(name@en, "Farhan Akhtar")) {
name@hi
name@en
director.film {
name@ru:hi:en
name@en
name@hi
name@ru
}
}
}
Example result (only the bit about director.film
, for brevity):
"director.film": [
{
"name@ru:hi:en": "दिल चाहता है"
}
]
I can see it’s been resolved to hindi, but it’s not labeled as hindi. It’s labeled as ru:hi:en
Why that wasn’t great, with examples
It would be nicer to have an indication on the language of the result (and ideally the prompt as well). Like:
"director.film": [
{
"name@hi": "दिल चाहता है"
}
]
or
"director.film": [
{
"name@ru:hi:en": { "hi": "दिल चाहता है"}
}
]
PS: I’ve been instructed to CC @campoy on this one