Templates / sequenceDiagram
GraphQL resolver sequence
A query resolving through a batched data loader to avoid the N+1 query problem.
Preview
Mermaid 11 renderer
Rendering preview...
Mermaid source
sequenceDiagram
sequenceDiagram
participant Client
participant GW as GraphQL gateway
participant Resolver
participant Loader as DataLoader
participant DB
Client->>GW: query { posts { author } }
GW->>Resolver: resolve posts
Resolver->>DB: SELECT posts
DB-->>Resolver: post rows
loop for each post
Resolver->>Loader: load(authorId)
end
Loader->>DB: batched SELECT authors WHERE id IN (...)
DB-->>Loader: author rows
Loader-->>Resolver: authors keyed by id
Resolver-->>GW: posts with authors
GW-->>Client: responseMore templates
flowchartArchitecture
Microservices architecture
A service map with an API gateway, core services, and shared infrastructure. A solid starting point for README architecture sections.
sequenceDiagramProcess
User login sequence
A login flow with token issuance and a failure branch. Useful for documenting auth endpoints and session behavior.
stateDiagram-v2Process
Order state machine
Lifecycle states for an e-commerce order, from creation to fulfillment, with cancellation and refund paths.