# SOS!All accessible nodes of a node

**URL:** <https://discuss.dgraph.io/t/sos-all-accessible-nodes-of-a-node/7191>\
**Category:** Dgraph\
**Tags:** graphql\
**Created:** [June 14, 2020, 4:50am UTC](https://discuss.dgraph.io/t/sos-all-accessible-nodes-of-a-node/7191 "2020-06-14T04:50:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luke](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/luke/32/10557_2.png) [@luke](https://discuss.dgraph.io/u/luke)\
**Post date:** [June 14, 2020, 4:50am UTC](https://discuss.dgraph.io/t/sos-all-accessible-nodes-of-a-node/7191/1 "2020-06-14T04:50:14Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![abhimanyusinghgaur](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/abhimanyusinghgaur/32/2980_2.png) [@abhimanyusinghgaur](https://discuss.dgraph.io/u/abhimanyusinghgaur)\
**Post date:** [June 14, 2020, 5:04am UTC](https://discuss.dgraph.io/t/sos-all-accessible-nodes-of-a-node/7191/2 "2020-06-14T05:04:53Z")

</div>

Will this work for you?

```auto
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.

---

<div class="post-metadata">

**Author:** ![luke](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/luke/32/10557_2.png) [@luke](https://discuss.dgraph.io/u/luke)\
**Post date:** [June 14, 2020, 5:08am UTC](https://discuss.dgraph.io/t/sos-all-accessible-nodes-of-a-node/7191/3 "2020-06-14T05:08:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Anurag](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/anurag/32/2599_2.png) [@Anurag](https://discuss.dgraph.io/u/Anurag)\
**Post date:** [June 14, 2020, 5:12am UTC](https://discuss.dgraph.io/t/sos-all-accessible-nodes-of-a-node/7191/4 "2020-06-14T05:12:38Z")

</div>

Try recurse, that should work for your use case.

---

<div class="post-metadata">

**Author:** ![luke](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/luke/32/10557_2.png) [@luke](https://discuss.dgraph.io/u/luke)\
**Post date:** [June 14, 2020, 5:16am UTC](https://discuss.dgraph.io/t/sos-all-accessible-nodes-of-a-node/7191/5 "2020-06-14T05:16:21Z")

</div>

ok thanks 😊 recurse can work for it
