Bird
0
0

Why does GraphQL enforce enum values to be uppercase and not allow lowercase or mixed case?

hard📝 Conceptual Q10 of 15
GraphQL - Schema Definition Language (SDL)
Why does GraphQL enforce enum values to be uppercase and not allow lowercase or mixed case?
ABecause lowercase enum values cause runtime errors
BTo distinguish enum values from field names and improve readability
CTo match JSON naming conventions
DBecause GraphQL only supports uppercase strings
Step-by-Step Solution
Solution:
  1. Step 1: Understand GraphQL naming conventions

    Uppercase enum values help distinguish them from fields and improve schema clarity.
  2. Step 2: Evaluate other options

    Lowercase does not cause errors; JSON allows mixed case; GraphQL supports all strings.
  3. Final Answer:

    To distinguish enum values from field names and improve readability -> Option B
  4. Quick Check:

    Uppercase enum values improve clarity and distinction [OK]
Quick Trick: Uppercase enum values improve schema clarity and avoid confusion [OK]
Common Mistakes:
  • Thinking lowercase causes errors
  • Confusing with JSON rules
  • Believing GraphQL limits string cases

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes