Section 6: Lab: Connecting to SQL Server with EF Core 10
- Create models, a DbContext and migrations on SQL Server 2025
- Register a DbContext factory for use with Hot Chocolate
- Resolvers that read data through the DbContext and injected services
- Nested fields for related data
- Lab: query products with their categories from a real database
Section 7: Lab: DataLoader and the N+1 Problem
- How the N+1 query problem arises in GraphQL
- Batch and group DataLoaders
- Create DataLoaders with the source generator
- Inspect the SQL actually sent with EF Core logging
- Lab: cut hundreds of database calls down to a handful
Section 8: Lab: Paging, Filtering, Sorting and Projection
- Cursor-based paging with connections, and offset paging
- Filtering and sorting translated into EF Core queries
- Projection so only the columns the client asks for are read
- Performance pitfalls and limiting page size
- Lab: a product search that filters, sorts and pages
Section 9: Lab: Mutations and Input Types
- Design mutations the recommended way, with inputs and payloads
- Hot Chocolate mutation conventions
- Create, update and delete data within a transaction
- Validate input before saving to the database
- Lab: a mutation that places an order and adjusts stock
Section 10: Error Handling and Validation
- How errors appear in a GraphQL response
- Errors modelled in the schema compared with system errors
- Error filters that keep internal details away from clients
- Query validation under the GraphQL specification
- Lab: return an error the client can display when stock runs out