0
0
GraphQLquery~10 mins

Basic query syntax 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 a user.

GraphQL
query { user { [1] } }
Drag options to blanks, or click blank then click option'
Aname
Bemail
Cage
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a field that does not exist or is not requested.
Forgetting to specify the field inside the user object.
2fill in blank
medium

Complete the code to query the email of a user.

GraphQL
query { user { [1] } }
Drag options to blanks, or click blank then click option'
Aemail
Bname
Cage
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a field like name instead of email.
Leaving the field blank.
3fill in blank
hard

Fix the error in the query to get the user's id.

GraphQL
query { user { [1] } }
Drag options to blanks, or click blank then click option'
Aage
Bid
Cemail
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong field like name or email.
Not specifying any field.
4fill in blank
hard

Fill both blanks to query the user's name and email.

GraphQL
query { user { [1] [2] } }
Drag options to blanks, or click blank then click option'
Aname
Bemail
Cage
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using fields that are not requested like age or id.
Only filling one blank.
5fill in blank
hard

Fill all three blanks to query the user's id, name, and email.

GraphQL
query { user { [1] [2] [3] } }
Drag options to blanks, or click blank then click option'
Aid
Bname
Cemail
Dage
Attempts:
3 left
💡 Hint
Common Mistakes
Including fields like age which are not requested.
Missing one or more blanks.