Bird
0
0

Consider this schema:

medium📝 Conceptual Q5 of 15
GraphQL - Type Relationships
Consider this schema:
type Employee { id: ID name: String manager: Employee }

What does the field 'manager' represent in this schema?
AA list of employees managed by this employee
BA scalar field storing manager's name as string
CAn unrelated field with no connection to Employee
DA self-referential relationship showing an employee's manager
Step-by-Step Solution
Solution:
  1. Step 1: Identify the type of the 'manager' field

    It is of type Employee, same as the enclosing type, so self-referential.
  2. Step 2: Interpret the meaning

    This models that an employee has one manager who is also an employee.
  3. Final Answer:

    A self-referential relationship showing an employee's manager -> Option D
  4. Quick Check:

    Self-reference means manager is an Employee = B [OK]
Quick Trick: Same type field means self-reference in GraphQL [OK]
Common Mistakes:
  • Thinking manager is a list of employees
  • Assuming manager is a string field
  • Ignoring self-referential meaning

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes