Order query

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.

I have split this topic from a previous topic. I will answer the question shortly.

Does something like this work @hianand

{
  q(func: eq(DocumentNo, "1234") )@recurse {
    uid
    child{}
  }
}

thanks that works, however, when i list the predicates inside the child node
I get this error

{
q(func: eq(DocumentNo, “1000450071”) )@recurse {
uid
DocumentType
Material
Plant
Batch
DocumentNo
Quantity

  child {
  
  u as uid 

}

}

c(func: uid(u)){ Plant}
}

or
{
q(func: eq(DocumentNo, “1000450071”) )@recurse {
uid
DocumentType
Material
Plant
Batch
DocumentNo
Quantity

  child {
  
  Plant
  DocumentType

}

}

}

“recurse queries require that all predicates are specified in one level”