---
title: inputObjectType
codeStyle: true
---

## inputObjectType

[GraphQL Docs for Input Object Types](https://graphql.org/learn/schema/#input-types)

Defines a complex object which can be passed as an input value.

```ts
import { extendType, inputObjectType } from 'nexus'

export const CommentInputType = inputObjectType({
  name: 'CommentInputType',
  definition(t) {
    t.nonNull.int('userId')
    t.nonNull.string('body')
  }
})

export const CommentMutation = extendType({
  type: 'Mutation',
  definition(t) {
    t.field('createComment', {
      type: 'Comment',
      args: { data: CommentInputType },
      resolve(_root, args, ctx) {
        return ctx.prisma.comment.create({
          data: {
            user_id: args.userId,
            body: args.body,
          }
        })
      }
    })
  },
})
```

Unlike object types, input types do not have arguments, so they do not have resolvers or "backing types"
