hasInverse and how its different from using @reverse on predicates

My fault is that it has been supported in v20.07.0.
For me, I just need to change the schema from

type person {
    id: String! @id @search(by: [hash])
    primary_name: String @search(by: [term,fulltext])
    portray: [character] @dgraph(pred: "~character.performance")
}
type character {
    primary_name: String! @search(by: [term])
    performance: person @hasInverse(field: portray)
}

to

type person {
    id: String! @id @search(by: [hash])
    primary_name: String @search(by: [term,fulltext])
    portray: [character] @dgraph(pred: "~character.performance")
}
type character {
    primary_name: String! @search(by: [term])
    performance: person @dgraph(pred: "character.performance")
}
1 Like