Find paths between one node and a group of nodes

I’m making a new comment, since the other one is growing large… But first: IGNORE THE RECURSE ISSUES I HAD IN THE COMMENT ABOVE.

The issues were caused by not following the edges direction correctly, so I solved it by making a reverse lookup.

{
  q(func: eq(number, "3429d692")) @recurse(loop: true, depth: 1000) {
    number 
    name
    ~origins
    ~assembledFrom
    ~processedFrom
    company
  }
}

In the picture above I’ve placed the nodes and edges according to the previous picture I posted. This query seems to satisfy what I’m looking for. Although it would return a lot of extra data since it’s returning the entire tree, when I’m actually just interested in the entire tree leading to a specific end node. I’m still very happy to get some help in this issue.

I have a problem with the query still, it seems like 4 nodes are missing for 2 different nodes. They are marked as red circles in the image. These seem to be missing because of the way I’m storing the directions of the edges and querying for it. I’m going to look over my dataset and make sure it’s all correct before going further.

EDIT: Got the Recursive query working. It would still be great if it’s possible to get DGraph filter out all paths that’s not of interest, worst case I’ll have to fetch the entire subtree for a node and filter out that myself :+1: