Complete the code to define an input type for a user with name and age fields.
input UserInput { name: String[1] }? which is not valid in GraphQL type definitions.The exclamation mark ! means the field is required (non-nullable).
Complete the code to add an age field of type Int to the input type.
input UserInput { age: [1] }Float which allows decimals.String which is for text.The Int type is used for integer numbers in GraphQL.
Fix the error in the mutation argument by completing the input type usage.
type Mutation { createUser(input: [1]): User }User instead of the input type.The argument should use the input type UserInput defined for complex inputs.
Complete the code to define an input type with a required name and optional email.
input ContactInput { name: String[1], email: String }? which is invalid in GraphQL.The name is required so it uses !. The email is optional so it has no exclamation mark.
Fill all three blanks to define a mutation that takes a required input and returns a User type.
type Mutation { addUser(input: [1][2]): [3] }The mutation argument uses the required input type UserInput! and returns the User type.