# dataTypeBySlug

Audience: Programmer

Returns the latest non-deleted DataType version for the given slug within the caller's tenant, or null if no version exists.

Returns the latest non-deleted DataType version for the given slug within
the caller's tenant, or null if no version exists. Convenience wrapper
for the relay query ``dataTypes(where: {slug}, orderBy: {field: VERSION, direction: DESC}, first: 1)``.

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

## Arguments

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `slug` | String! |  |  |

## Returns

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

## Example

Returns the latest non-deleted DataType version for the given slug within the caller's tenant, or null if no version exists.

```graphql
query GetDataTypeBySlug($slug: String!) {
  dataTypeBySlug(slug: $slug) {
    createdAt
    createdBy
    default
    deletedAt
    deletedBy
    description
    entity
    frontendSchema
    id
    jsonSchema
    name
    slug
    tenantID
    updatedAt
    updatedBy
    version
  }
}
```

**Variables**

```json
{
  "slug": "<data type slug, e.g. customer>"
}
```
