Bird
0
0

Consider this enum definition:

medium📝 Debug Q6 of 15
GraphQL - Schema Definition Language (SDL)
Consider this enum definition:
enum Level { BEGINNER INTERMEDIATE ADVANCED }

Which of the following enum definitions will cause a schema validation error?
Aenum Level { BEGINNER INTERMEDIATE ADVANCED1 }
Benum Level { BEGINNER INTERMEDIATE ADVANCED }
Cenum Level { BEGINNER INTERMEDIATE ADVANCED_ }
Denum Level { BEGINNER INTERMEDIATE ADVANCED BEGINNER }
Step-by-Step Solution
Solution:
  1. Step 1: Check for duplicate enum values

    Enum values must be unique; enum Level { BEGINNER INTERMEDIATE ADVANCED BEGINNER } repeats BEGINNER twice.
  2. Step 2: Validate other options

    Options C and D use valid names; underscore and digits allowed if not starting with digit.
  3. Final Answer:

    enum Level { BEGINNER INTERMEDIATE ADVANCED BEGINNER } -> Option D
  4. Quick Check:

    Enum values must be unique [OK]
Quick Trick: Enum values cannot repeat; duplicates cause errors [OK]
Common Mistakes:
  • Allowing duplicate values
  • Thinking underscore or digits are invalid
  • Confusing duplicates with similar names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes