SOS!All accessible nodes of a node

such as:node A and his edges (B,C,D) and then B with edges(E,F,) and then F with edges(J,K) i just want to find all of the nodes that A can access to (B C D E F J K)

Will this work for you?

query {
  nodesFromA(func: uid(<uid_of_A>)) {
    uid
    expand(_all_) {
      uid
      expand(_all_) {
        uid
        expand(_all_) {
          uid
        }
      }
    }
  }
}

It will give you all the nodes you can reach from A, till 3 levels deep inside A.

Thanks,but we can not know how many nodes A can access which means ‘expand’ is not controllable

Try recurse, that should work for your use case.

2 Likes

ok thanks :blush: recurse can work for it