Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to query the name of a user.
GraphQL
query { user(id: 1) { [1] } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a field that does not represent the user's name.
Leaving the field blank.
✗ Incorrect
The field name returns the user's name as requested.
2fill in blank
mediumComplete the code to fetch the user's email address.
GraphQL
query { user(id: 2) { [1] } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting a field unrelated to email.
Confusing 'email' with 'address'.
✗ Incorrect
The email field returns the user's email address.
3fill in blank
hardFix the error in the query to get the user's age.
GraphQL
query { user(id: 3) { [1] } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a field that does not exist or is unrelated to age.
Misspelling the field name.
✗ Incorrect
The field age correctly fetches the user's age.
4fill in blank
hardFill both blanks to query user's name and email.
GraphQL
query { user(id: 4) { [1] [2] } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting fields unrelated to name or email.
Using the same field twice.
✗ Incorrect
To get both name and email, include name and email fields.
5fill in blank
hardFill all three blanks to query user's name, email, and age.
GraphQL
query { user(id: 5) { [1] [2] [3] } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Including unrelated fields like address.
Missing one of the required fields.
✗ Incorrect
The fields name, email, and age fetch the requested user information.