You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using i18n predicates, such as those in Cyrillic, for unique fields, these predicates are added without <> in the addQueryIfUnique function, leading to a query error.
I propose adding the following code to dgraph/graph/server.go at line 1744 before if !strings.HasPrefix(pred.ObjectId, "val("){....}
such a code
if !isLatinString(predicateName) {
predicateName = fmt.Sprintf(`<%v>`, predicateName)
}
func isLatinString(s string) bool {
for _, r := range s {
if !unicode.IsLetter(r) || !unicode.Is(unicode.Latin, r) {
return false
}
}
return true
}
func addQueryIfUnique(qc *queryContext) error {
...
if !isLatinString(predicateName) {
predicateName = fmt.Sprintf(`<%v>`, predicateName)
}
if !strings.HasPrefix(pred.ObjectId, "val(") {
....
}
}
Links to Discuss, RFC or previous Issues and PRs
No response
Links to examples and research
No response
Current state
No response
Solution proposal
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Use case
When using i18n predicates, such as those in Cyrillic, for unique fields, these predicates are added without <> in the addQueryIfUnique function, leading to a query error.
I propose adding the following code to dgraph/graph/server.go at line 1744 before
if !strings.HasPrefix(pred.ObjectId, "val("){....}
such a code
Links to Discuss, RFC or previous Issues and PRs
No response
Links to examples and research
No response
Current state
No response
Solution proposal
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: