✨ ARCANUM RUNE DIFFICULTY: Adept Structural

The Decorator Directives

Dynamically enchanting schema elements with additional behaviors.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Transmutation // Enchantment
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# The Decorators (Directives)
directive @requiresAura(color: String!) on FIELD_DEFINITION
directive @deprecatedMagic(reason: String = "No longer recommended") on FIELD_DEFINITION | ENUM_VALUE

type Relic {
  id: ID!
  name: String!
  
  # Decorated fields altering behavior or metadata
  hiddenPower: Int! @requiresAura(color: "PURPLE")
  obsoleteSpell: String @deprecatedMagic(reason: "Replaced by modern enchantments")
}

Directives are the native Decorators of the Graph Oracle. They allow you to attach metadata or modify the behavior of types, fields, and arguments without altering the underlying resolver logic, seamlessly layering enchantments like authorization or deprecation.

Runic Tags: #graphql #structural #decorator #directives