Bird
0
0

Identify the error in this GraphQL query:

medium📝 Debug Q6 of 15
GraphQL - Queries
Identify the error in this GraphQL query:
{ user { posts comments { text } } }
AMissing braces around nested comments inside posts
BIncorrect field name 'comments'
CMissing argument for user field
DUsing dot notation instead of braces
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the query structure

    The query has posts and comments { text } at the same level under user.
  2. Step 2: Identify nesting error

    Likely, comments should be nested inside posts, but here it is separate without braces.
  3. Final Answer:

    Missing braces around nested comments inside posts -> Option A
  4. Quick Check:

    Nested fields must be inside braces [OK]
Quick Trick: Always wrap nested fields in braces inside their parent field [OK]
Common Mistakes:
  • Placing nested fields at wrong level
  • Forgetting braces for nested fields
  • Assuming dot notation works for nesting

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes