Bird
0
0

You have this schema:

medium📝 Debug Q6 of 15
GraphQL - Type Relationships
You have this schema:
type Post { author: User } type User { posts: [Post] }

Why does this query cause an error?
{ post { author { posts } } }
A<code>author</code> field is not defined
B<code>posts</code> field must be scalar
CMissing <code>id</code> field in <code>posts</code> selection
DQuery syntax is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Check the query selection set

    The query requests posts but does not specify any fields inside the list.
  2. Step 2: Understand GraphQL selection rules

    GraphQL requires selecting fields inside objects or lists; empty selections cause errors.
  3. Final Answer:

    Missing id field in posts selection -> Option C
  4. Quick Check:

    Always select fields inside object lists [OK]
Quick Trick: Select fields inside lists, not just the list name [OK]
Common Mistakes:
  • Leaving selection sets empty
  • Assuming scalar fields can be lists
  • Ignoring GraphQL query syntax rules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes