In the dgraph schema, if there is an interface that two types implement but both the types have the exact same fields then how to write it?

You may write the same fields in the implementing types.

You can use this schema in this case:

interface mammal {
  id: ID
  fur: Boolean
  height: Int
}

type cat implements mammal {
  id: ID
  fur: Boolean
  height: Int
}

type cow implements mammal {
  id: ID
  fur: Boolean
  height: Int
}

Linking related discuss post: Interfaces are not GraphQL compliant

1 Like