# emptyInstance

Source: https://taxilang.org/docs/language/stdlib/emptyInstance

**Full name:** `taxi.stdlib.emptyInstance`

## Signature

```taxi
declare extension function <A> emptyInstance(instanceType:lang.taxi.Type<A>): A
```

## Description

Returns an instance of the requested type with all fields set to their empty state: scalars are `null`, collections are `[]`, and nested objects are recursively emptied.

```taxi
// Create a blank template of a type
find {
   blank: MyModel = emptyInstance(MyModel)
}
```

## Examples

Creates an empty instance of a model: scalars are null and collections are empty arrays.

Schema:

```taxi
type UserTag inherits String
model User {
   name: UserName inherits String
   age: Age inherits Int
   tags: UserTag[]
}
```

Query:

```taxi
find {
   empty: User = emptyInstance(User)
}
```

Result:

```json
{
  "empty": {
    "name": null,
    "age": null,
    "tags": []
  }
}
```
