Allow @hasInverse on union types

But @hasInverse has no relevance outside of dgraph anyway, so does it really matter if the schema would still be valid? Dgraph could just check if all union members implement the required field and throw an error if not.

Alternatively, we could be more specific and allow @hasInverse only on unions which members implement the same interface:

type Foo {
   m: [Bar!]! @hasInverse(field: foo, interface: Hello)
}

interface Hello {
   foo: Foo!
}

union Bar = Blub | Blabla

type Blub implements Hello {
   ...
}

type Blabla implements Hello {
   ...
}
1 Like