Input types are used to define structured data that can be passed as arguments, primarily in mutations.
Instead of passing multiple individual arguments, input types group related fields into a single object.
input BookAppointmentInput {
userId: ID!
doctorId: ID!
date: String!
}
BookAppointmentInput is an input typetype Mutation {
bookAppointment(input: BookAppointmentInput!): Appointment
}
mutation BookAppointment($input: BookAppointmentInput!) {
bookAppointment(input: $input) {
id
date
}
}
{
"input": {
"userId": "1",
"doctorId": "10",
"date": "2026-05-05"
}
}