The Iterator of Epochs
Sequentially accessing the elements of a vast collection.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Iterator
ARCANUM SCHOOL: Evocation // Traversal
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# The Relay Connection pattern (Iterator)
type ArtifactConnection {
edges: [ArtifactEdge!]!
pageInfo: PageInfo!
}
type ArtifactEdge {
cursor: String!
node: Artifact!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
type Artifact {
id: ID!
name: String!
}
type Query {
# Iterating through artifacts using cursors
listArtifacts(first: Int, after: String): ArtifactConnection!
}
The Iterator pattern in the Graph Oracle is universally recognized as the Relay Connection specification. By using Cursors and PageInfo, casters can traverse massive, seemingly infinite collections of entities sequentially without loading the entire compendium into memory.
Runic Tags:
#graphql
#behavioral
#iterator
#pagination
#relay