# Can I modify an existing node's type?

**URL:** <https://discuss.dgraph.io/t/can-i-modify-an-existing-nodes-type/17694>\
**Category:** Dgraph\
**Tags:** kind:question, dql\
**Created:** [August 26, 2022, 3:58am UTC](https://discuss.dgraph.io/t/can-i-modify-an-existing-nodes-type/17694 "2022-08-26T03:58:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SHDavies](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/shdavies/32/9971_2.png) [@SHDavies](https://discuss.dgraph.io/u/SHDavies)\
**Post date:** [August 26, 2022, 3:58am UTC](https://discuss.dgraph.io/t/can-i-modify-an-existing-nodes-type/17694/1 "2022-08-26T03:58:37Z")

</div>

## What I want to do

Add/delete/change an existing node’s type

## What I did

I have tried deleting a node’s type and adding new ones but it seems to do nothing.

```auto
{
  delete {
    <0xc> <dgraph.type> "User" .
  }
}

```

```auto
{
  set {
    <0xc> <dgraph.type> "OtherType" .
  }
}

```

I don’t know if this is even possible, but if it is I must be missing something. I can’t find anything in the docs except assigning types to a new node.

Also, if it matters I’m on Dgraph Cloud.

---

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [August 26, 2022, 6:15pm UTC](https://discuss.dgraph.io/t/can-i-modify-an-existing-nodes-type/17694/2 "2022-08-26T18:15:40Z")

</div>

’ The type is just a regular predicate. A node can have 0 or more dgraph.type values for instance if it is a type implementing an interface then it would have a type value for both the interface and the implemented type. In DQL nodes can also have predicates and edges that are not of the type of the node although they can’t be queried through the GraphQL API.

---

<div class="post-metadata">

**Author:** ![SHDavies](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/shdavies/32/9971_2.png) [@SHDavies](https://discuss.dgraph.io/u/SHDavies)\
**Post date:** [August 26, 2022, 6:17pm UTC](https://discuss.dgraph.io/t/can-i-modify-an-existing-nodes-type/17694/3 "2022-08-26T18:17:36Z")

</div>

That’s what I would have assumed but running the mutations above did nothing.

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [August 26, 2022, 6:54pm UTC](https://discuss.dgraph.io/t/can-i-modify-an-existing-nodes-type/17694/4 "2022-08-26T18:54:08Z")

</div>

Check if you are using “commit now”.I’ve just tested your preposition, and it is working as expected.

First:

```auto
{
  set {
    <_:New> <dgraph.type> "User" .
  }
}

```

```auto
{
  result(func: uid(0x4)) {
      dgraph.type
  }
}

```

Second:

```auto
{
  delete {
    <0x4> <dgraph.type> "User" .
  }
}

```

Third:

```auto
{
  set {
    <0x4> <dgraph.type> "OtherType" .
  }
}

```

Finally:

```auto
{
  result(func: uid(0x4)) {
      dgraph.type
  }
}

{
  "data": {
    "result": [
      {
        "dgraph.type": [
          "OtherType"
        ]
      }
    ]
  }

```
