0
0
GraphQLquery~10 mins

Nested field queries 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 query the name of all books.

GraphQL
query { books { [1] } }
Drag options to blanks, or click blank then click option'
Atitle
Byear
Cauthor
Dpublisher
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing author instead of title.
Using a field that does not exist in the schema.
2fill in blank
medium

Complete the code to get the author's name for each book.

GraphQL
query { books { author { [1] } } }
Drag options to blanks, or click blank then click option'
AbirthYear
Bid
Cnationality
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting id instead of name.
Choosing a field unrelated to the author's name.
3fill in blank
hard

Fix the error in the query to get the book's title and the author's birth year.

GraphQL
query { books { title author { [1] } } }
Drag options to blanks, or click blank then click option'
Abirth_year
BbirthYear
Cbirthyear
DyearBorn
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect casing like birthyear.
Using snake_case instead of camelCase.
4fill in blank
hard

Fill both blanks to query each book's title and the author's nationality.

GraphQL
query { books { [1] author { [2] } } }
Drag options to blanks, or click blank then click option'
Atitle
Bname
Cnationality
DbirthYear
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up name and nationality.
Using fields that don't exist in the schema.
5fill in blank
hard

Fill all three blanks to query the book's title, author's name, and author's birth year.

GraphQL
query { books { [1] author { [2] [3] } } }
Drag options to blanks, or click blank then click option'
Atitle
Bname
CbirthYear
Dnationality
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to include all three fields.
Using incorrect field names or casing.