# \[Bug\] Deleting interfaces is breaking inverse relationships

**URL:** <https://discuss.dgraph.io/t/bug-deleting-interfaces-is-breaking-inverse-relationships/14409>\
**Category:** GraphQL\
**Tags:** graphql, status:accepted, kind:bug, ticket:created\
**Created:** [June 2, 2021, 9:23am UTC](https://discuss.dgraph.io/t/bug-deleting-interfaces-is-breaking-inverse-relationships/14409 "2021-06-02T09:23:11Z")\
**Posts on this page:** 3\
**Page:** 1

<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 2, 2021, 9:23am UTC](https://discuss.dgraph.io/t/bug-deleting-interfaces-is-breaking-inverse-relationships/14409/1 "2021-06-02T09:23:11Z")

</div>

When using the delete mutation for interfaces, inverse relationships of implementing types are not correctly handled.

Schema:

```auto
type Foo {
    id: String! @id
    bars: [Bar!]! @hasInverse(field: foo)
}

interface Cuid {
    id: String! @id
}

type Bar implements Cuid {
    foo: Foo!
}

```

Add Foo with Bar:

```auto
mutation {
  addFoo(input: { id: "foo", bars: [{ id: "bar" }] }) {
    numUids
  }
}

```

Delete Bar:

```auto
mutation {
  deleteCuid(filter: { id: { eq: "bar" } }) {
    msg
  }
}

```

Query Foo and Bars:

```auto
query {
  queryFoo {
    id
    bars {
      id
    }
  }
}

```

Error:

```auto
Non-nullable field 'id' (type String!) was not present in result from Dgraph. GraphQL error propagation triggered.
"path": [
        "queryFoo",
        0,
        "bars",
        0,
        "id"
]

```

When using the `deleteBar` mutation instead, the inverse relationship is correctly deleted.

I’d expect the `deleteCuid` mutation to do the same.

---

<div class="post-metadata">

**Author:** ![rajas](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/rajas/32/4393_2.png) [@rajas](https://discuss.dgraph.io/u/rajas)\
**Post date:** [June 2, 2021, 1:09pm UTC](https://discuss.dgraph.io/t/bug-deleting-interfaces-is-breaking-inverse-relationships/14409/2 "2021-06-02T13:09:54Z")

</div>

Hi @maaft ,

Thanks for the bug report and for the simple reproducible example. I am able to reproduce this on `master`, `21.03` and `20.11`.  
I am accepting this as a bug. This will be fixed in coming days.

---

<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 12, 2021, 7:26am UTC](https://discuss.dgraph.io/t/bug-deleting-interfaces-is-breaking-inverse-relationships/14409/4 "2021-08-12T07:26:53Z")

</div>

Hi @rajas ! Has this been fixed?
