The Abstract Factory of the Graph Oracle
Conjuring families of related mystical entities through unified interfaces.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Abstract Factory
ARCANUM SCHOOL: Conjuration // Interfaces
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# The Abstract Factory defining the creation of related artifacts
interface MagicalArtifact {
id: ID!
powerLevel: Int!
name: String!
}
type Wand implements MagicalArtifact {
id: ID!
powerLevel: Int!
name: String!
core: String!
woodType: String!
}
type Staff implements MagicalArtifact {
id: ID!
powerLevel: Int!
name: String!
gemstone: String!
height: Float!
}
# The Oracle providing the factory methods
type Query {
# Returns a family of artifacts, abstracting the exact types
conjureArtifacts(element: String!): [MagicalArtifact!]!
}
The Abstract Factory in the Graph Oracle allows you to request families of related entities without coupling to their concrete forms. By utilizing interfaces and unions, the oracle determines the precise manifestation of the requested artifacts.
Runic Tags:
#graphql
#interfaces
#unions
#creational
#abstract-factory