0
0
GraphQLquery~10 mins

Field-level errors 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 request a field that might return an error.

GraphQL
query { user { name email [1] } }
Drag options to blanks, or click blank then click option'
Aerror
Baddress
Cage
Dphone
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a regular data field like 'age' or 'phone' instead of the error field.
2fill in blank
medium

Complete the code to handle errors for a nested field.

GraphQL
query { product { id name reviews [1] } }
Drag options to blanks, or click blank then click option'
Acomment
Brating
Cerror
Ddate
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting a normal data field like 'rating' or 'comment' instead of the error field.
3fill in blank
hard

Fix the error in the query to correctly request field-level errors.

GraphQL
query { order { id total [1] } }
Drag options to blanks, or click blank then click option'
Aerror_code
BerrorMessage
Cerrors
Derror
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural or underscored versions like 'errors' or 'error_code' which are not standard.
4fill in blank
hard

Fill both blanks to request a field and its error message.

GraphQL
query { user { [1] [2] } }
Drag options to blanks, or click blank then click option'
Aemail
Berror
Cmessage
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing two data fields instead of including the error field.
5fill in blank
hard

Fill all three blanks to request a nested field, its error, and the error message.

GraphQL
query { post { comments { [1] [2] { [3] } } } }
Drag options to blanks, or click blank then click option'
Atext
Berror
Cmessage
Dauthor
Attempts:
3 left
💡 Hint
Common Mistakes
Not nesting the message inside the error field.