-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(query): fix has function in filter (#87)
Currently when we have a language tagged predicate (example: name). Querying name should return only untagged values. name@. should return any language. Consider dataset <1> <name> "first user" . <2> <name@en> "second user" . query (func: uid(1,2)) { uid name} would return "{uid: 1, name: first user}". query (func: uid(1,2)) { uid name@.} would return "{{uid: 1, name@.: "first user"}, {uid: 2, name@.: "second user"}}". However due to a bug, we are not enforcing this in @filter(has(name)). So this results in query (func: has(dgraph.type)) @filter(has(name)) { uid name} results in "{{uid: 1, name: "first user'}, {uid: 2}}" Fix: We update @filter(has(name)) to filter on basis of language. Fixes: https://linear.app/hypermode/issue/HYP-311/inconsistent-counts-using-has-at-root --------- Co-authored-by: Harshil Goel <harshil@dgraph.io>
- Loading branch information
1 parent
3754e87
commit 2d7dc22
Showing
2 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters