# Feature Request | Interface implements Interface

**URL:** <https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978>\
**Category:** GraphQL\
**Tags:** kind:feature\
**Created:** [February 26, 2021, 12:29pm UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978 "2021-02-26T12:29:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luscha](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/luscha/32/3588_2.png) [@Luscha](https://discuss.dgraph.io/u/Luscha)\
**Post date:** [February 26, 2021, 12:29pm UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978/1 "2021-02-26T12:29:02Z")

</div>

As the [GraphQL Standard just added the capability](https://github.com/graphql/graphql-spec/pull/373) of an `Interface` to implement other `Interface` I would hear your mind about the possibility of Dgraph to align to the standard.

By my side, I can bring some use-case and opinion about the topic, since I felt from the first moment I used Dgraph that the ability of interfaces to implement other interfaces would bring a big value to developers and schema designers.

### Use case:

I want all the types of my only-append database to implement an interface which carries metainformation like custom id, creation date, visibility, deletion time, …  
I then want to create an interface `Product` to expose common information, like name, description, price about the products sold in my E-Commerce.  
I then want to implement some actual product like `Skirt` and `Shoes`.  
Finally i want to have a `Chart` type holding all the products an user is about to purchase.

```auto
interface Metadata {
   id: String! @id @search
   crationDate: DateTime!
   deletionDate: DateTime!
   visible: Boolean! 
}

interface Product {
    price: Int!
    name: String!
    description: String!
}

type Shoes implements Metadata & Product {
   size: Int!
   ....
}

type Skirt implements Metadata & Product {
   height: Int!
   width: Int!
   ....
}

type Metadata & Chart {
    items: [Product!]!
}

```

Since `Chart.items` is an array of `Product` the mutation generated by dgraph won’t include the setter for the item field, since it can’t generate the getter of the interface `Product` (because it doesn’t have any searchable field) so i lose quite some functionalities.  
Direct side effect of this is that it is quite difficult to add `@hasInverse` to those properties which implements an interface that is not searchable because it is not possible to create `Chart` → `Product` edge but mutating the `Product` itself eg:

```auto
interface Product {
    price: Int!
    name: String!
    description: String!
    inCharts: [Chart!]! 
}

type Metadata & Chart {
    items: [Product!]! @hasInverse(field: inCharts)
}

```

Dgraph does not generate the queryProduct as well, since it has not a searchable field, leaving the developer to either query the actual types separately, or to use queryMetadata and spread the Product fragment.

Allowing interface to inherit fields for other interfaces will lead to more customizable and manageable schemas, relieving quite some pain to developers.

### Opinion

Most of database or framework can work without this feature, because in the above scenario someone could just create a resolver `queryProduct` and perform a custom query on the underlying database and manually manage all resolutions (which is something he has to do anyway).  
Dgraph gives the power of an autogenerated GraphQL interface, but makes it quite difficult to implement basic custom queries or mutation like `queryProduct` by hand, leading to workarounds and limitations.

---

<div class="post-metadata">

**Author:** ![maaft](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@maaft](https://discuss.dgraph.io/u/maaft)\
**Post date:** [March 29, 2021, 1:06pm UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978/2 "2021-03-29T13:06:07Z")

</div>

[@graphql](https://discuss.dgraph.io/groups/graphql) have you considered this? Seems like something that should be supported.

> [@Can interfaces implement other interfaces in GraphQL?](http://discuss.hypermode.com/t/can-interfaces-implement-other-interfaces-in-graphql/10013/5):
>
> [@graphql](https://discuss.dgraph.io/groups/graphql) can this be re-opened please?

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [March 29, 2021, 11:37pm UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978/3 "2021-03-29T23:37:20Z")

</div>

Also marking this as a feature request

---

<div class="post-metadata">

**Author:** ![maaft](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@maaft](https://discuss.dgraph.io/u/maaft)\
**Post date:** [June 1, 2021, 9:33am UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978/4 "2021-06-01T09:33:01Z")

</div>

Hi,

are there any updates on this?

I have another issue which I cannot solve currently, which would be possible when interfaces of interfaces would be implemented.

I have a list of `foos` and some of them should have inverse edges to another type. This is currently not possible (also not with [union types](http://discuss.hypermode.com/t/allow-hasinverse-on-union-types/11618)).

Here is what I try to achieve (names are random and follow now inherent logic):

```auto
type Bar {
  foos: [Foo!]!
}

interface Foo {
   id: String! @id
}

interface Callable implements Foo {
   callback: Callback! @hasInverse(field: callable)
}

type Callback {
  callable: Callable!
}

```

---

<div class="post-metadata">

**Author:** ![maaft](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@maaft](https://discuss.dgraph.io/u/maaft)\
**Post date:** [August 11, 2021, 3:12pm UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978/5 "2021-08-11T15:12:06Z")

</div>

I’m really pulling my hair out because this feature is still missing.

Can we please have an update on this? Thanks!

---

<div class="post-metadata">

**Author:** ![kolmez](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/kolmez/32/8710_2.png) [@kolmez](https://discuss.dgraph.io/u/kolmez)\
**Post date:** [September 26, 2021, 5:51pm UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978/6 "2021-09-26T17:51:11Z")

</div>

Also waiting for this…

---

<div class="post-metadata">

**Author:** ![maaft](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@maaft](https://discuss.dgraph.io/u/maaft)\
**Post date:** [October 5, 2021, 10:09am UTC](https://discuss.dgraph.io/t/feature-request-interface-implements-interface/12978/7 "2021-10-05T10:09:46Z")

</div>

@mrjn @chewxy @aman-bansal @dmai is there any progress on this?
