Hi,
we are working on poc using dgraph.
i have following requirement to build graph layout.
we have two types of nodes OrderNode & Batch Node
type <OrderNode> {
DocumentNo
DocumentType
ProductionOrder
PurchaseOrder
Vendor
child
}
type <BatchNode> {
Plant
Material
Batch
DocumentType
child
}
<child>: [uid] @reverse .
child is of type uid and is list with index, reverse as well.
I have build parent and child relationship
OrderNode
is generally parent for Mutliple Batch
Nodes
BatchNode
can be parent of Multiple Batch Nodes so on.
I want to be able to search either by Batch or orderNo,
I should be able to list child and parents.
My first use case is to list childs to detail
I tried to query and want to list a graph in recursive manner
OrderNode → Child → BatchNode2–> Batch Node 2
for eg) when I search with this query recursively , I don’t get lower childs (child batches of batches are not coming up)
i get only one level though depth is stated as 3
{
var(func: eq(DocumentNo, "1800002473")) @recurse(depth:3 , loop:true) @normalize {
u as uid
Plant
Material
DocumentType
}
childs(func: uid(u)) {
expand(_all_) {
Batch
Material
Plant
}
}
}
I have the same problem when querying batches instead of orders.