{
tree( func:uid(0xb303e) )
{
name
~parent_tree
{
uid
dgraph.type
name
}
}
}
And it works where the dgraph.type is “Defect”
But when I ran a similar query with a type filter:
{
tree( func:uid(0xb303e) )
{
name
~parent_tree @filter(type(Defect))
{
uid
dgraph.type
name
}
}
}
It returns blank for the predicate ~parent_tree
Originally this query works when there is only one uid in parent_tree, but when I added a second uid to become [ uid_1, uid_2 ] in the predicate parent_tree. It failed to retrieve when I ran a filter.
Did I made some mistake here?
Update: Weirdly, filtering by type works for some UID but fail for some other UID. It is not clear why there is such behaviour.
Could you please share what version and cluster setup of Dgraph are you using? Also, could you share some sample mutation set data and your schema so that we can try and replicate the issue on a fresh install at our end?
From Ratel UI i see my localhost:8080 dgraph v1.2.1
I only have one Zero(Community Edition) and One Alpha(v1.2.1 from Ratel U1) running on S3 EC2.
The Schema for Tree is
The issue arises sometimes when d_1 is connect to the tree t_3.
after connecting the ~parent_tree @filter(type(Defect)) fails for t_1 and it returns blank.
at the same time ~parent_tree @filter(type(Defect)) fails for t_3 and it returns blank.
the reason for filtering by type is “tree 1”, t_1, has two type of ~parent_tree : Tree(t_2) and Defect(d_1).
In your data, I don’t see any dgraph.type edges being stored for your data. Hence type(Defect) or for that matter any type filter won’t work. If you can share the full data on which you are trying to run this query, then I might be able to help you more. I think you need more edges like