Equivalent of @reverse (DQL) in Graphql

I need to be able to search in both directions of a certain edge in a given type. Im writing my schemas in Graphql. Since @reverse is only available in DQL and not in GraphQL, is there any way I could have an equivalent functionality ? If it matters, its a list of edges for each node, not a single reference. Like:

type MyType{
friend: [MyType] << I want ~friend
}

I’ve seen @hasInverse bu the examples are only in different types and from a single/list to single, not list-list

Yeah, this can’t be done out-of-the-box:

Basically, you need to add every node manually in a linked node… OR…

use custom dql to query how you want.

https://dgraph.io/docs/graphql/custom/dql/

J

2 Likes