Complete the code to define a GraphQL query that fetches user data.
query GetUser { user(id: [1]) { name email } }The user ID must be a string in quotes in GraphQL queries.
Complete the code to add an authorization header to a GraphQL request.
fetch('/graphql', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': [1] }, body: JSON.stringify({ query }) })
The Authorization header value must be a string with 'Bearer ' prefix and token in quotes.
Fix the error in the GraphQL schema definition for a secure user type.
type User { id: ID! name: String! email: [1] }Email should be a String type in GraphQL schema.
Fill both blanks to create a GraphQL query that limits data exposure by requesting only id and name.
query GetUsers { users { [1] [2] } }Requesting only 'id' and 'name' limits sensitive data exposure like email or password.
Fill all three blanks to write a GraphQL mutation that updates a user's email securely.
mutation UpdateUserEmail { updateUser(id: [1], email: [2]) { [3] } }The mutation requires the user ID and new email as strings, and returns the updated email field.