Bird
0
0

This schema snippet causes an error:

medium📝 Debug Q7 of 15
GraphQL - Basics and Philosophy
This schema snippet causes an error:
type User { id: ID! name: String! }

What is the likely cause?
AString! cannot be non-nullable
BMissing newline or separator between fields
CID! is invalid syntax
DUser type must have a Query field
Step-by-Step Solution
Solution:
  1. Step 1: Check SDL field syntax

    Fields must be separated by newlines or commas; missing newline causes syntax error.
  2. Step 2: Identify fix

    Adding a newline between 'id: ID!' and 'name: String!' resolves the error.
  3. Final Answer:

    Missing newline or separator between fields -> Option B
  4. Quick Check:

    Fields need proper separation in SDL [OK]
Quick Trick: Separate fields with newlines or commas [OK]
Common Mistakes:
  • Thinking ID! is invalid
  • Believing non-null String is wrong
  • Expecting Query field in type User

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes