# How to implement @recurse + expand(\_all\_)

**URL:** <https://discuss.dgraph.io/t/how-to-implement-recurse-expand-all/17431>\
**Category:** Users\
**Tags:** kind:question\
**Created:** [June 17, 2022, 6:47am UTC](https://discuss.dgraph.io/t/how-to-implement-recurse-expand-all/17431 "2022-06-17T06:47:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atidat](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@atidat](https://discuss.dgraph.io/u/atidat)\
**Post date:** [June 17, 2022, 6:47am UTC](https://discuss.dgraph.io/t/how-to-implement-recurse-expand-all/17431/1 "2022-06-17T06:47:33Z")

</div>

The Users category is meant for asking questions and discussing things. However, we have specific categories for some things. We would appreciate if you could post in the correct category.

| Is Your Question About | Correct Category |
| --- | --- |
| Dgraph | Users \> Dgraph |
| GraphQL | Users \> GraphQL |
| Slash GraphQL | Users \> Slash GraphQL |
| Ratel | Users \> Ratel |
| Badger | Users \> Badger |
| Ristretto | Users \> Ristretto |

Otherwise, you may continue posting here.  
------------------------------------------------ … ------------------------------------------------  
[MODEL]  
type Person {  
pname string  
}  
type Car {  
color string  
link Person  
}  
pname: string @index(exact) .  
color: @string @index(exact) .  
link: uid @reverse .

I want to query one car’s all info by pname, BUT the query not work  
{  
node(func: eq(pname, “wZGWuMneOg”)) {  
~link{  
tar as uid  
}  
}  
q(func: uid(tar)) @recurse{  
expand(_all_)  
}  
}

FYI  
The official user guide is so unfriendlly and example is too less. Really want to give up using DGraph

---

<div class="post-metadata">

**Author:** ![atidat](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@atidat](https://discuss.dgraph.io/u/atidat)\
**Post date:** [June 17, 2022, 7:28am UTC](https://discuss.dgraph.io/t/how-to-implement-recurse-expand-all/17431/2 "2022-06-17T07:28:46Z")

</div>

@dmai

---

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [June 18, 2022, 3:47am UTC](https://discuss.dgraph.io/t/how-to-implement-recurse-expand-all/17431/3 "2022-06-18T03:47:39Z")

</div>

Are you using DQL with a GrapQL schema? How did you input/mutate your data?

---

<div class="post-metadata">

**Author:** ![atidat](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@atidat](https://discuss.dgraph.io/u/atidat)\
**Post date:** [June 22, 2022, 2:27am UTC](https://discuss.dgraph.io/t/how-to-implement-recurse-expand-all/17431/4 "2022-06-22T02:27:40Z")

</div>

Finally, in order to get backward edges, I use “big wild table”, each real table link to TABLE TABLE.

* * *

so the input like this,  
{  
q(func: eq(actor\_name, “Bruce Lee”)) {  
~movie\_actor {  
tar as uid  
}  
}  
query(func: uid(tar)) {  
expand(_all_) {  
expand(_all_)  
}  
}  
}

* * *

FYI. My data models like this:

\_:actor \<actor\_name\> “Bruce Lee” .  
\_:actor \<dgraph.type\> “Actor” .  
\_:director \<director\_name\> “Sp” .  
\_:director \<dgraph.type\> “Director” .  
\_:car \<car\_model\> “Tesla” .  
\_:car \<dgraph.type\> “Car” .  
\_:staff \<staff\_name\> “Andy” .  
\_:staff \<dgraph.type\> “Staff” .  
\_:tag \<tag\_name\> “Comedy” .  
\_:tag \<dgraph.type\> “Tag” .  
\_:movie \<movie\_name\> “Q” .  
\_:movie \<dgraph.type\> “Movie” .  
\_:movie \<movie\_actor\> \_:actor .  
\_:movie \<movie\_director\> \_:director .  
\_:movie \<movie\_staff\> \_:staff .  
\_:movie \<movie\_tag\> \_:tag .  
\_:staff \<staff\_car\> \_:car .

As you saw, Each Type links to MOVIE type, as Two Level Tree

So, I could get whole relevant data by inputing only three conditions which are “actor\_name,” “Bruce Lee” and “movie\_type” in my java/go code.

BTW, why “_forward_” is deprecated?

Thanks.
