0
0
GraphQLquery~10 mins

Filtering arguments in GraphQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A"25"
Btrue
Cage
D25
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around the number, which makes it a string.
Passing a boolean value instead of a number.
2fill in blank
medium

Complete 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'
A"electronics"
Btrue
Ccategory
Delectronics
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the category without quotes, causing a syntax error.
Using a boolean value instead of a string.
3fill in blank
hard

Fix 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'
ATrue
Btrue
C"true"
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around boolean values.
Capitalizing boolean values incorrectly.
4fill in blank
hard

Fill 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'
A"J.K. Rowling"
BJ.K. Rowling
C2020
D"2020"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing author without quotes.
Passing year as a string with quotes.
5fill in blank
hard

Fill 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'
A"New York"
B"2023-07-01"
Ctrue
D2023-07-01
Attempts:
3 left
💡 Hint
Common Mistakes
Passing date without quotes.
Passing boolean as a string.
Forgetting quotes around location.