---
title: Simple and flat inputs
sidebar_label: Simple inputs
sidebar_position: 9
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

In version 2.6.0, Prisma released `atomicNumberOperations` preview feature that allows you to update scalar fields without checking the current value, e.g. increment or decrement a number value.

However, GraphQL does not support input unions, hence it's not possible to support both simple scalar fields and atomic operation inputs at the same time. So, if you prefer simplicity over more complex approach using nested inputs, you can provide the `useSimpleInputs` generator option:

```prisma
generator typegraphql {
  provider        = "typegraphql-prisma"
  output          = "../prisma/generated/type-graphql"
  // highlight-next-line
  useSimpleInputs = true
}
```

By using this option, instead of generating nested inputs with `IntFieldUpdateOperationsInput` or `StringFieldUpdateOperationsInput` as a field type, it will emit much simpler version of inputs for update operations - with just scalar values:

<Tabs>
<TabItem value="true" label="useSimpleInputs = true">

```ts
@TypeGraphQL.InputType("CategoryUpdateInput", {
  isAbstract: true,
})
export class CategoryUpdateInput {
  @TypeGraphQL.Field(_type => String, {
    nullable: true,
  })
  name?: string | undefined;

  @TypeGraphQL.Field(_type => String, {
    nullable: true,
  })
  slug?: string | undefined;

  @TypeGraphQL.Field(_type => TypeGraphQL.Int, {
    nullable: true,
  })
  number?: number | undefined;
}
```

</TabItem>
<TabItem value="false" label="useSimpleInputs = false">

```ts
@TypeGraphQL.InputType("CategoryUpdateInput", {
  isAbstract: true,
})
export class CategoryUpdateInput {
  @TypeGraphQL.Field(_type => StringFieldUpdateOperationsInput, {
    nullable: true,
  })
  name?: StringFieldUpdateOperationsInput | undefined;

  @TypeGraphQL.Field(_type => StringFieldUpdateOperationsInput, {
    nullable: true,
  })
  slug?: StringFieldUpdateOperationsInput | undefined;

  @TypeGraphQL.Field(_type => IntFieldUpdateOperationsInput, {
    nullable: true,
  })
  number?: IntFieldUpdateOperationsInput | undefined;
}
```

</TabItem>
</Tabs>

Same goes to array fields and nested documents, when you're using MongoDB as your Prisma db provider.
By using this option, instead of generating nested inputs with `XYZEnvelopeInput` or `FooCreateBarInput` as a field type, it will emit much simpler version of inputs:

<Tabs>
<TabItem value="true" label="useSimpleInputs = true">

```ts
@TypeGraphQL.InputType("UserUpdateInput", {
  isAbstract: true,
})
export class UserUpdateInput {
  @TypeGraphQL.Field(_type => [TypeGraphQL.Int], {
    nullable: true,
  })
  luckyNumbers?: number[] | undefined;

  @TypeGraphQL.Field(_type => UserAddressCreateInput, {
    nullable: true,
  })
  address?: UserAddressCreateInput | undefined;
}
```

</TabItem>
<TabItem value="false" label="useSimpleInputs = false">

```ts
@TypeGraphQL.InputType("UserUpdateInput", {
  isAbstract: true,
})
export class UserUpdateInput {
  @TypeGraphQL.Field(_type => UserCreateluckyNumbersInput, {
    nullable: true,
  })
  luckyNumbers?: UserCreateluckyNumbersInput | undefined;

  @TypeGraphQL.Field(_type => UserAddressUpdateEnvelopeInput, {
    nullable: true,
  })
  address?: UserAddressUpdateEnvelopeInput | undefined;
}
```

</TabItem>
</Tabs>
