0
0
GraphQLquery~10 mins

Over-fetching and under-fetching problems 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 fetch only the user's name in a GraphQL query.

GraphQL
query { user { [1] } }
Drag options to blanks, or click blank then click option'
Aemail
Bname
Cid
Dposts
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'posts' fetches too much data, causing over-fetching.
Choosing 'email' or 'id' fetches different data than the name.
2fill in blank
medium

Complete the code to fetch a user's posts with only the post titles.

GraphQL
query { user { posts { [1] } } }
Drag options to blanks, or click blank then click option'
Atitle
Bauthor
Ccontent
Ddate
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'content' fetches the full post text, causing over-fetching.
Choosing 'author' or 'date' fetches unrelated data.
3fill in blank
hard

Fix the error in the query to avoid under-fetching user email.

GraphQL
query { user { name [1] } }
Drag options to blanks, or click blank then click option'
Aemail
Bposts
C}
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing '}' fetches only name, still under-fetching email.
Choosing 'posts' fetches extra data, causing over-fetching.
Choosing 'id' fetches id instead of email.
4fill in blank
hard

Fill both blanks to fetch user's name and email without over-fetching.

GraphQL
query { user { [1] [2] } }
Drag options to blanks, or click blank then click option'
Aname
Bposts
Cemail
Dcomments
Attempts:
3 left
💡 Hint
Common Mistakes
Including 'posts' or 'comments' fetches too much data.
Missing either 'name' or 'email' causes under-fetching.
5fill in blank
hard

Fill all three blanks to fetch post title, author name, and post date without extra data.

GraphQL
query { post { [1] author { [2] } [3] } }
Drag options to blanks, or click blank then click option'
Atitle
Bname
Cdate
Dcontent
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'content' fetches too much data.
Missing any of the three fields causes under-fetching.