Bird
0
0

Identify the error in this input type definition:

medium📝 Debug Q14 of 15
GraphQL - Schema Definition Language (SDL)
Identify the error in this input type definition:
input UserInput { id: ID! name: String age: Int! }
ASyntax is correct; no error
BInput types cannot have non-null fields
CMissing commas between fields
DField names must be lowercase
Step-by-Step Solution
Solution:
  1. Step 1: Review GraphQL input type syntax rules

    Input types list fields with their types separated by spaces or new lines; commas are not required.
  2. Step 2: Check each option against syntax

    Input types cannot have non-null fields is false; non-null fields are allowed. Field names must be lowercase is false; field names can be camelCase or lowercase. Missing commas between fields is false; commas are optional. Syntax is correct; no error is true; the syntax is valid.
  3. Final Answer:

    Syntax is correct; no error -> Option A
  4. Quick Check:

    Input fields separated by spaces, commas optional [OK]
Quick Trick: Commas are optional between fields in input types [OK]
Common Mistakes:
  • Thinking commas are mandatory
  • Believing non-null fields are disallowed
  • Assuming field names must be lowercase only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes