Complete the code to define a GraphQL type for a user with an ID.
type User { id: [1] }The ID! type is used for unique identifiers and the exclamation mark means it is required.
Complete the code to add a name field of type String to the User type.
type User { name: [1] }The String type is used for text fields like names.
Fix the error in the schema by completing the type definition correctly.
type User { id: ID, name: [1] }The name field should be a required string, so use String!.
Fill both blanks to define a Query type with a user field returning a User by ID.
type Query { user(id: [1]): [2] }The user query takes a required ID! argument and returns a User type.
Fill all three blanks to define a Mutation type with createUser taking a name and returning a User.
type Mutation { createUser(name: [1]): [2] } type User { id: [3] }The createUser mutation takes a required String! name and returns a User. The User type has an id of type ID!.