0
0
GraphQLquery~10 mins

Partial success responses 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 partial success response with errors included.

GraphQL
query { user(id: 1) { name email } } [1]
Drag options to blanks, or click blank then click option'
Apartial { success }
Bextensions { code }
Cerrors { message }
Ddata { user }
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to use 'extensions' or 'partial' fields which are not standard for partial success.
Expecting 'data' field to show errors.
2fill in blank
medium

Complete the code to handle partial success by checking if errors exist.

GraphQL
if (response.[1]) { console.log('Partial success with errors'); }
Drag options to blanks, or click blank then click option'
Adata
Bpartial
Cextensions
Derrors
Attempts:
3 left
💡 Hint
Common Mistakes
Checking 'data' instead of 'errors'.
Using non-standard fields like 'partial'.
3fill in blank
hard

Fix the error in the code to correctly access partial success errors.

GraphQL
const errors = response.data.[1];
Drag options to blanks, or click blank then click option'
Aerror
Berrors
Cextensions
DpartialErrors
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to access errors inside data.
Using incorrect field names like 'error' or 'partialErrors'.
4fill in blank
hard

Fill both blanks to create a query that requests user data and includes error messages for partial success.

GraphQL
query { user(id: 2) { name email } } [1] { [2] { message } }
Drag options to blanks, or click blank then click option'
Aerrors
Bextensions
Dpartial
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'extensions' or 'partial' instead of 'errors'.
Not requesting the message field inside errors.
5fill in blank
hard

Fill all three blanks to handle a GraphQL response with partial success, logging data and errors separately.

GraphQL
if (response.[1]) { console.log('Errors:', response.[2]); } else { console.log('Data:', response.[3]); }
Drag options to blanks, or click blank then click option'
Aerrors
Cdata
Dextensions
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'extensions' with 'errors'.
Logging errors inside data or vice versa.