GraphQL schema does not create predicate to self node

When apply GraphQL schema (as following) why

sameAs: [Identifier] @hasInverse(field: "sameAs")

line from the schema is ignored in DGraph. As you can see on picture there is no sameAs predicate created. I was expecting to see something like `sameAs : [uid]’

enum Gender {
    male
    female
}
interface Identifier {
    code: String! @search(by: [hash])
    target: String! @search(by: [hash])
    yob: Int
    sameAs: [Identifier] @hasInverse(field: "sameAs")
    gender: Gender
    zip: String
    city: String
    education: String
    profession: String
    version: DateTime! @search(by: [hour])
    ts: DateTime!
}
type BidIdentifier implements Identifier 
type EmailIdentifier implements Identifier
type UidIdentifier implements Identifier

Hi,

Thanks for reporting this. I’ve checked and can reproduce the same problem. I’ve added this issue on GitHub for you GraphQL interfaces can't reference themselves · Issue #5311 · dgraph-io/dgraph · GitHub

We’ll try and get it fixed for the next patch release (20.03.2)

1 Like