How chillicream/graphql-workshop works
1. This repository is a workshop-style .NET 8 solution that evolves a GraphQL server across seven sessions. The most complete implementation is in code/session-7, while earlier session folders are intermediate checkpoints showing how the architecture grows over time.
2. The core runtime is an ASP.NET Core GraphQL server built with Hot Chocolate. Program.cs in each session is the composition root: it wires the GraphQL server, registers application services, and connects the schema to the database-backed domain model.
3. Persistence is handled with Entity Framework Core. The Data folder contains the ApplicationDbContext, entity classes, and migrations; these define the relational model for conference planning data such as speakers, sessions, attendees, tracks, and join entities like SessionAttendee and SessionSpeaker.
4. The application is organized by GraphQL domain area rather than by classic web layers. In the later sessions, the schema is split into Sessions, Speakers, Attendees, and Tracks, each with its own queries, mutations, object types, input types, loaders, exceptions, and in some cases subscriptions.
5. Data flow is GraphQL request → resolver/mutation → EF Core/DbContext → database. Queries generally read through Hot Chocolate types and DataLoaders; mutations create or update entities and return typed payloads; the database is the shared backing store for all modules.
6. DataLoader usage is a major architectural boundary. Session 2 introduces loaders to avoid N+1 access patterns, and later sessions expand that pattern per domain so object graph navigation is resolved through batched lookups rather than ad hoc database calls.
7. The schema layer is strongly modeled. Types like SessionType, SpeakerType, AttendeeType, and TrackType define how domain entities are exposed to GraphQL, while input classes like AddSessionInput, RegisterAttendeeInput, and RenameTrackInput define write operations and shape the mutation boundary.
8. Session 4 introduces custom GraphQL middleware and descriptor extensions. The Extensions folder contains reusable schema-building behavior such as UseUpperCaseAttribute and object field descriptor helpers, which means some field behavior is enforced centrally rather than inside individual resolvers.
9. Session 5 adds more advanced filtering on sessions. SessionFilterInputType shows that the query layer is no longer just simple entity retrieval; it now supports richer search/filter semantics that sit between GraphQL clients and the EF Core-backed query model.
10. Session 6 introduces real-time behavior through subscriptions. The Subscriptions classes in Attendees and Sessions indicate a publish/subscribe path alongside the normal query/mutation flow, so clients can receive event-driven updates for conference activity.
11. Session 7 adds automated testing as a first-class architectural component. GraphQL.Tests contains schema tests and mutation tests with snapshot files, so schema shape and resolver behavior are validated as part of the repo’s contract.
12. Tooling and environment setup are lightweight but important: the repo pins .NET tooling via .config/dotnet-tools.json, uses docker-compose.yml per session for local dependencies, and stores app settings per environment. The docs and saved schema snapshots in GraphQL.Tests/__snapshots__ serve as the authoritative reference for expected API behavior.
Main entry points: Program.cs Program · Data Data model · Sessions Sessions · GraphQL Session 2
Components 17
Workshop sessions
Seven checkpoints showing the architecture evolving over time.
- Session 1 · Initial GraphQL server and first speaker mutation/query slice.
code/session-1/GraphQL - Session 2 · Adds DataLoader-based access and broader conference data model.
code/session-2/GraphQL - Session 3 · Splits the schema into Sessions, Speakers, Attendees, and Tracks.
code/session-3/GraphQL - Session 4 · Introduces reusable GraphQL middleware and descriptor extensions.
code/session-4/GraphQL - Session 5 · Adds richer session filtering in the query layer.
code/session-5/GraphQL - Session 6 · Adds subscriptions for real-time conference updates.
code/session-6/GraphQL - Session 7 · Final server with tests and snapshot-backed schema verification.
code/session-7/GraphQL
Final app
The session-7 GraphQL server and its major runtime boundaries.
- Program · ASP.NET Core startup that wires Hot Chocolate, EF Core, and domain modules.
code/session-7/GraphQL/Program.cs - Data model · DbContext, entities, and migrations for conference planning persistence.
code/session-7/GraphQL/Data - Sessions · Session queries, mutations, filtering, subscriptions, loaders, and types.
code/session-7/GraphQL/Sessions - Speakers · Speaker queries, mutations, loaders, and GraphQL type mapping.
code/session-7/GraphQL/Speakers - Attendees · Attendee queries, mutations, subscriptions, loaders, and check-in flow.
code/session-7/GraphQL/Attendees - Tracks · Track queries, mutations, loaders, and domain exceptions.
code/session-7/GraphQL/Tracks - Extensions · Shared schema-building behavior and custom field conventions.
code/session-7/GraphQL/Extensions
Support
Tooling, tests, and documentation around the workshop.
- GraphQL tests · Schema and mutation tests with snapshots for API contract coverage.
code/session-7/GraphQL.Tests - Workshop docs · Session-by-session workshop material and architecture notes.
docs - Dotnet tools · Pinned local .NET tooling configuration for the workshop.
code/session-7/.config
Connections 20
- Session 1 → Session 2: evolves into · The initial server grows DataLoader-backed access patterns.
- Session 2 → Session 3: splits into · The schema is organized into domain-specific modules.
- Session 3 → Session 4: adds · Shared middleware and descriptor extensions are introduced.
- Session 4 → Session 5: extends · Session queries gain richer filtering semantics.
- Session 5 → Session 6: adds · Subscriptions introduce real-time event flow.
- Session 6 → Session 7: finalized by · Testing becomes part of the repository contract.
- Program → Data model: configures · Startup wires persistence and schema dependencies.
- Program → Sessions: registers · The composition root adds the sessions module.
- Program → Speakers: registers · The composition root adds the speakers module.
- Program → Attendees: registers · The composition root adds the attendees module.
- Program → Tracks: registers · The composition root adds the tracks module.
- Program → Extensions: applies · Central schema conventions are applied during setup.
- Sessions → Data model: reads/writes · Session operations flow through EF Core and the shared database.
- Speakers → Data model: reads/writes · Speaker operations persist through the DbContext.
- Attendees → Data model: reads/writes · Attendee registration and check-in persist through EF Core.
- Tracks → Data model: reads/writes · Track operations use the shared relational model.
- Sessions → Extensions: uses · Session fields can inherit shared middleware behavior.
- GraphQL tests → Program: verifies · Tests exercise the server composition and schema behavior.
- Workshop docs → Session 7: describes · Workshop docs explain the final architecture and its progression.
- Dotnet tools → Program: supports · Pinned tooling supports local development and workshop execution.