Build the mental model
When a mutation needs many scalar arguments, an `input` object type groups them into one — input types look like output object types syntactically, but their fields may only be scalars, enums, or other input types, never regular object types. Nesting a list of input types (`lessons: [LessonInput!]!`) inside an input lets you create a tutorial and its lessons in a single request.
Connect it to a real scenario
The author dashboard's "create tutorial" form submits one `CreateTutorialInput` containing `title`, `difficulty`, and `lessons` (each with `title`/`durationMinutes`). The resolver validates lesson-list length and duration ranges at the application level, then inserts the tutorial and its lessons inside one database transaction.
Try the working example
input LessonInput {
title: String!
durationMinutes: Int!
}
input CreateTutorialInput {
title: String!
difficulty: Difficulty!
lessons: [LessonInput!]!
}
mutation CreateTutorial($input: CreateTutorialInput!) {
createTutorial(input: $input) {
id
title
lessons {
title
}
}
}You can write a mutation with a nested input type that creates related records in one request.5-minute try-it
Write an `UpdateTutorialInput` (`title`, `summary`, `difficulty` — all optional) and design an `updateTutorial` mutation that supports partial updates.
One important caution
Trying to use a regular output object type (like `Author`) as a field type inside an input type fails schema validation — input-type fields must themselves be input types.