Bird
0
0

Given this GraphQL type:

hard📝 Application Q9 of 15
GraphQL - Schema Definition Language (SDL)
Given this GraphQL type:
type Profile {
  id: ID!
  username: String!
  emails: [String!]!
  bio: String
}

Which statement correctly describes the emails field?
A<code>emails</code> is a required list with nullable strings
B<code>emails</code> is an optional list with nullable strings
C<code>emails</code> is an optional list with required strings
D<code>emails</code> is a required list with required non-null strings
Step-by-Step Solution
Solution:
  1. Step 1: Analyze emails: [String!]!

    The ! after String means each string is non-null.
  2. Step 2: The ! after the list means the list itself is required and non-null.

  3. Final Answer:

    emails is a required list with required non-null strings -> Option D
  4. Quick Check:

    Required list and elements = C [OK]
Quick Trick: ! inside list means elements required; outside means list required [OK]
Common Mistakes:
  • Mixing element and list nullability
  • Ignoring ! placement
  • Assuming optional list when ! is present

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes