Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to filter users by their age.
GraphQL
query { users(age: [1]) { id name } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around the number, which makes it a string.
Passing a boolean value instead of a number.
✗ Incorrect
The age argument expects a number without quotes to filter users by age.
2fill in blank
mediumComplete the code to filter products by category.
GraphQL
query { products(category: [1]) { id name price } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the category without quotes, causing a syntax error.
Using a boolean value instead of a string.
✗ Incorrect
The category argument expects a string value, so it must be enclosed in quotes.
3fill in blank
hardFix the error in the query to filter posts by published status.
GraphQL
query { posts(published: [1]) { id title } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around boolean values.
Capitalizing boolean values incorrectly.
✗ Incorrect
The published argument expects a boolean value without quotes and lowercase.
4fill in blank
hardFill both blanks to filter books by author and year.
GraphQL
query { books(author: [1], year: [2]) { title author year } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing author without quotes.
Passing year as a string with quotes.
✗ Incorrect
The author argument expects a string with quotes, and the year expects a number without quotes.
5fill in blank
hardFill all three blanks to filter events by location, date, and isActive status.
GraphQL
query { events(location: [1], date: [2], isActive: [3]) { id name location date isActive } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing date without quotes.
Passing boolean as a string.
Forgetting quotes around location.
✗ Incorrect
Location and date are strings and need quotes; isActive is a boolean and does not need quotes.