If I want the right language to show in Dart client, should I then keep track of Dart client and dgraph @dk and pass that information between client ad dgraph back and forth?
Predicates (including language-specific predicates) are handled the same way from the client’s perspective. The client sends the query to Dgraph and receives the response accordingly.
You can check one of the official Dgraph client implementations like dgo to see how client handles queries.
I agree and that will be the way around, but I just want to minimise requests. First I thought of “@.” as a kind of fallback/default for untagged strings.
Scenario: a query for friends where you don’t know the language tagged upfront.
But I guess it is not a big deal, to make a second request with another language, than the language from the initially request.
But it will require some logic handling different language than the current user - if you use the scenario with friends.
But name@en:. will match english first, then untagged, then anything (I’m assuming the first). If you allow your users to enter any number of language variants, that is obviously not quite good enough.
Perhaps you should consider using two predicates:
preferred.user.name@.
secondary.user.name@{{client_users_lang}}:.
That way, you could choose which is the best fit for the current client.
Predicates vs. edges: No, I not totally sure what the difference is… Predicates are the types, I suppose, edges are the actual triple (including any reverse edges, if mandated by the schema). Still evaluating Dgraph.