Bird
0
0

Consider this GraphQL type:

medium📝 query result Q5 of 15
GraphQL - Schema Definition Language (SDL)
Consider this GraphQL type:
type Order {
  id: ID!
  items: [String!]!
  total: Float
}

Which statement is true about the items field?
AIt is a non-null list containing non-null strings
BIt is a list of nullable strings and the list itself can be null
CIt is a list that can be null but contains non-null strings
DIt is a nullable list of nullable strings
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the type [String!]!

    The inner String! means each string in the list cannot be null.
  2. Step 2: The outer ! means the list itself cannot be null

    So the list must exist and contain only non-null strings.
  3. Final Answer:

    It is a non-null list containing non-null strings -> Option A
  4. Quick Check:

    Non-null list + non-null items = C [OK]
Quick Trick: Outer ! means list required, inner ! means items required [OK]
Common Mistakes:
  • Ignoring outer ! and thinking list can be null
  • Ignoring inner ! and thinking items can be null
  • Confusing list nullability with item nullability

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes