Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
email or id instead of name.✗ Incorrect
The field name fetches the user's name in the query.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing
content or date instead of title.✗ Incorrect
The title field fetches the title of each post.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
emails or userEmail which do not exist.✗ Incorrect
The correct field to fetch the user's email is email.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing
content or author instead of publishedDate.✗ Incorrect
The query fetches title and publishedDate fields for posts.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
name @upperCase which is not valid here.✗ Incorrect
The query fetches name (normal), count as postsCount, and title of posts.