GraphQL API with .NET 5 and Hot Chocolate

Опубликовано: 30 Январь 2025
на канале: Les Jackson
240,360
4.6k

In this step-by-step tutorial I take you through how build a GraphQL API using C#9, .NET 5 and the Hot Chocolate framework.

The video covers:

Application Architecture Overview
GraphQL theory and core concepts
Building Queries
Multi-threaded queries using Pooled DBContextFactory
Sorting & Filtering
Building Mutations
Building Subscriptions (real-time event notifications with Web Sockets)

Level: Intermediate

📕 My Book: https://www.apress.com/gp/book/978148...
🤩 Patreon Site (Exclusive Member Benefits!):   / binarythistle  
📕 Webhooks Course on Udemy: https://www.udemy.com/course/webhooks...
💻 GitHub Repo: https://github.com/binarythistle/S04E...
🔗 WSL Install: https://docs.microsoft.com/en-us/wind...
🔗 Installing Docker in WSL: https://docs.docker.com/docker-for-wi...
🔗 Visual Studio Code: https://code.visualstudio.com/download
🔗 SQL Server Express: https://www.microsoft.com/en-au/sql-s...
🔗 Visual Studio: https://visualstudio.microsoft.com/do...
🔗 Insomnia: https://insomnia.rest/
🔗 SQL Server on Docker: https://hub.docker.com/_/microsoft-ms...
🔗 SQL Server Management Studio: https://aka.ms/ssmsfullsetup
🔗 GraphQL Voyager: https://github.com/APIs-guru/graphql-...
🔗 GraphQL Official Site: https://graphql.org/
🔗 Chilli Cream / Hot Chocolate Site: https://chillicream.com/

⏲️ Time Codes ⏲️

PART 1 - INTRODUCTION
0:48 Welcome
2:38 Demo
11:10 Course Overview
14:03 Architecture
17:15 Ingredients

PART 2 - THEORY
19:26 What is GraphQL?
20:17 GraphQL Core Concepts
24:22 REST Vs GraphQL
31:22 GraphQL Frameworks in .NET

PART 3 - CODING PART 1
33:42 Environment Setup
38:44 Project Setup
47:58 Setup SQL Server with Docker
58:29 Configuration & Dependency Injection
1:10:41 Set up our 1st Model
1:14:20 Setup DB Context & Connection String
1:25:44 Migrate to DB
1:32:45 Create GraphQL Query
1:37:33 Configuring GraphQL Services (Startup Class)
1:38:54 Configuring GraphQL in Request Pipeline ()
1:40:03 Querying our endpoint with Banana Cake Pop & Insomnia
1:51:39 Setting up and using GraphQL Voyager
1:57:55 Concurrent quering issue
2:02:10 Introducing the Pooled DbContext Factory

PART 4 - CODING PART 2 - EXTENDING OUR QUERIES
2:06:49 Adding our 2nd Model
2:10:51 Update DBContext & Migrate
2:17:41 Querying with multi-model - using projection
2:24:40 Adding a Commands Query
2:28:44 Adding in-line documentation to our API
2:32:46 Annotation Vs Code First approaches
2:38:51 Adding a Platform Type with Resolver
2:51:08 Adding a Command Type with Resolver
3:00:11 Sorting & Filtering capabilities

PART 5 - CODING PART 3 - MUTATIONS & SUBSCRIPTIONS
3:07:05 Introducing Mutations & Adding Platforms
3:17:16 Testing our Platform Mutation
3:22:37 Adding a Commands Mutation
3:30:46 Testing our Commands Mutation
3:34:08 Adding Subscriptions (Real-time events)
3:43:01 Testing our Subscription

PART 6 - WRAP UP
3:45:23 Wrap up and Final thoughts
3:46:48 Patreon Supporter Credits