# updateDataType

Audience: Developer

Updates an existing DataType in place.

Updates an existing DataType in place. `name` is the only mutable business
field on DataType — every other field is immutable, so UpdateDataTypeInput
exposes only `name` (a schema change requires `createDataType` with the same
slug to produce a new version).

**Served by:** [management](https://docs.pyck.cloud/api/services/management.md)

## Arguments

| Name | Type |
| --- | --- |
| `id` | ID! |
| `input` | [UpdateDataTypeInput](https://docs.pyck.cloud/api/inputs/updatedatatypeinput.md)! |

## Returns

[DataType](https://docs.pyck.cloud/api/types/datatype.md)!

## Example

Updates a data type's name in place. `name` is the only mutable field on a DataType and every other field is immutable, so a schema change requires a new version via createDataType with the same slug.

```graphql
mutation UpdateDataType($id: ID!, $input: UpdateDataTypeInput!) {
  updateDataType(id: $id, input: $input) {
    createdAt
    createdBy
    default
    deletedAt
    deletedBy
    description
    entity
    frontendSchema
    id
    jsonSchema
    name
    slug
    tenantID
    updatedAt
    updatedBy
    version
  }
}
```

**Variables**

```json
{
  "id": "<data type ID>",
  "input": {
    "name": "Updated Customer Type"
  }
}
```
