The Builder's Ritual
Constructing complex magical constructs step-by-step using input types.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Builder
ARCANUM SCHOOL: Conjuration // Inputs
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# The blueprint for our complex construct
input GolemBuilderInput {
material: MaterialType!
height: Float!
runes: [String!]
boundSpirit: SpiritInput
}
enum MaterialType {
CLAY
STONE
IRON
CRYSTAL
}
input SpiritInput {
trueName: String!
elementalAffinity: String!
}
type Golem {
id: ID!
status: String!
power: Int!
}
type Mutation {
# The Builder method encapsulating complex creation
awakenGolem(blueprint: GolemBuilderInput!): Golem!
}
The Builder pattern translates elegantly into GraphQL via deeply nested Input Types. Rather than passing dozens of disparate arguments to a mutation, a single cohesive blueprint is offered to the Oracle, guiding the complex ritual of creation.
Runic Tags:
#graphql
#input-types
#mutations
#creational
#builder