Complete the code to define a GraphQL query that fetches a user's name.
query GetUserName { user(id: 1) { [1] } }The field name correctly fetches the user's name as requested.
Complete the code to add a variable for user ID in the query.
query GetUser($id: ID!) { user(id: [1]) { name } }The variable $id is used to pass the user ID dynamically to the query.
Fix the error in the mutation to update a user's email.
mutation UpdateEmail($id: ID!, $email: String!) { updateUser(id: [1], email: $email) { id email } }The variable $id must be used to pass the user ID in the mutation arguments.
Fill both blanks to define a fragment for user details and use it in a query.
fragment UserDetails on User { [1] [2] } query GetUser { user(id: 1) { ...UserDetails } }The fragment includes name and email fields to fetch user details.
Fill all three blanks to write a query with variables and aliasing.
query GetUserInfo($userId: ID!) { userInfo: user(id: [1]) { [2] email: [3] } }The query uses variable $userId for the ID, fetches name, and aliases emailAddress as email.
