Complete the code to define a GraphQL query that fetches a list of users.
query GetUsers { users [1] { id name email } }The keyword all is commonly used to fetch all records in a GraphQL query field.
Complete the code to add an argument that filters users by their status.
query GetActiveUsers { users(status: [1]) { id name } }GraphQL arguments require string values to be enclosed in double quotes, so "active" is correct.
Fix the error in the mutation to add a new user by completing the missing input type.
mutation AddUser { addUser(input: [1]) { id name } }The input type for adding a user is typically named CreateUserInput in many GraphQL schemas.
Fill both blanks to write a query that fetches posts with their author's name and filters posts published after 2020.
query GetRecentPosts { posts(filter: { publishedYear: [1] }) { title author { [2] } } }The filter should use a year after 2020, so 2021 is correct. The author's field to get the name is name.
Fill all three blanks to write a mutation that updates a user's email by ID and returns the updated email and name.
mutation UpdateUserEmail { updateUser(id: [1], input: { email: [2] }) { [3] email } }The user ID should be a string with quotes: "123". The new email is also a string with quotes. To return the user's name, use the field name.