Complete the code to define a simple GraphQL query that fetches a user's name.
query GetUserName { user(id: 1) { [1] } }The field name fetches the user's name as requested.
Complete the code to add a variable for user ID in the query.
query GetUserName($id: [1]) { user(id: $id) { name } }String or Boolean for the user ID variable type.The user ID is typically an integer, so Int is the correct type.
Fix the error in the query by completing the missing type declaration.
query GetUser($id: [1]!) { user(id: $id) { name } }The exclamation mark ! means the variable is required. The user ID should be an Int and required.
Fill both blanks to create a mutation that updates a user's email.
mutation UpdateEmail($id: [1]!, $email: [2]!) { updateUser(id: $id, email: $email) { id email } }
!.User ID is an Int! and email is a String! because emails are text.
Fill all three blanks to write a query that fetches a list of users with their IDs, names, and emails.
query GetUsers { users { [1] [2] [3] } }The query fetches id, name, and email for each user.
