How to implement @recurse + expand(_all_)

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

@dmai

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

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.