0
0
GraphQLquery~10 mins

Snapshot testing 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 write a GraphQL query that fetches the user's name.

GraphQL
query GetUserName { user { [1] } }
Drag options to blanks, or click blank then click option'
Aname
Bemail
Cid
Dage
Attempts:
3 left
💡 Hint
Common Mistakes
Using email or id instead of name.
2fill in blank
medium

Complete the code to fetch the user's posts with their titles.

GraphQL
query GetUserPosts { user { posts { [1] } } }
Drag options to blanks, or click blank then click option'
Acontent
Btitle
Cdate
Dauthor
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing content or date instead of title.
3fill in blank
hard

Fix the error in the query to fetch user's email correctly.

GraphQL
query GetUserEmail { user { [1] } }
Drag options to blanks, or click blank then click option'
Aemails
BuserEmail
Cemail
Dcontact
Attempts:
3 left
💡 Hint
Common Mistakes
Using emails or userEmail which do not exist.
4fill in blank
hard

Fill both blanks to query posts with title and published date.

GraphQL
query GetPosts { posts { [1] [2] } }
Drag options to blanks, or click blank then click option'
Atitle
Bcontent
CpublishedDate
Dauthor
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing content or author instead of publishedDate.
5fill in blank
hard

Fill all three blanks to query user with uppercase name, email, and posts count.

GraphQL
query GetUserDetails { user { [1] email postsCount: [2] posts { [3] } } }
Drag options to blanks, or click blank then click option'
Aname @upperCase
Bcount
Ctitle
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using name @upperCase which is not valid here.