Skip to content

Updated the workshop to .NET 8 and Hot Chocolate 14 #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 47 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b150b9c
Updated the workshop to .NET 8 and Hot Chocolate 14
glen-84 Aug 8, 2024
bcca937
Added session 3
glen-84 Aug 13, 2024
a2eccd9
Added session 4
glen-84 Aug 15, 2024
0d519af
Added session 5
glen-84 Aug 16, 2024
49a173b
Added session 6
glen-84 Aug 19, 2024
64f0813
Added session 7
glen-84 Aug 19, 2024
142e478
Added session 8
glen-84 Aug 20, 2024
8fa9b4c
Removed session 2
glen-84 Aug 20, 2024
c99011e
Removed first item in ToCs
glen-84 Aug 20, 2024
361fa3c
Removed unused images
glen-84 Aug 20, 2024
cf9f1f5
Removed `complete` directory
glen-84 Aug 20, 2024
6962c72
Made most properties init-only
glen-84 Aug 20, 2024
844e8af
Updated dependencies
glen-84 Aug 20, 2024
ed415c1
Updated dependencies
glen-84 Aug 22, 2024
be55922
Updated schema snapshot
glen-84 Aug 23, 2024
69946db
Removed trackByName/tracksByName
glen-84 Aug 23, 2024
4ece459
Updated screenshots
glen-84 Aug 23, 2024
9c5e643
Removed unused using directives
glen-84 Aug 23, 2024
9920057
Updated diagrams
glen-84 Aug 23, 2024
69e0ee8
Updated dependencies
glen-84 Aug 23, 2024
5829212
Switched to using the [BindMember] attribute
glen-84 Aug 23, 2024
ae04d23
Added solution that includes all projects
glen-84 Sep 9, 2024
f425ecb
Optimized DataLoaders
glen-84 Sep 9, 2024
042609f
Used DataLoader interfaces
glen-84 Sep 9, 2024
f274fc6
Added AsNoTracking
glen-84 Sep 9, 2024
10898f8
Updated dependencies
glen-84 Sep 9, 2024
a645caf
Restructured session 1 to ensure that the AddGraphQLTypes method exists
glen-84 Sep 20, 2024
cf33147
Updated dependencies
glen-84 Sep 23, 2024
0b1806f
Updated dependencies
glen-84 Sep 25, 2024
331c158
Added typeName argument for track ID
glen-84 Sep 25, 2024
394c2e8
Updated schema snapshot
glen-84 Sep 25, 2024
fc1177c
Added keyset and DataLoader pagination
glen-84 Sep 25, 2024
8f346a7
Updated dependencies
glen-84 Sep 30, 2024
5af7655
Used the generic version of the ID descriptor method
glen-84 Sep 30, 2024
ba587cb
Updated dependencies
glen-84 Oct 4, 2024
0232888
Fix mismatched curly brackets in 3-schema-design.md SessionDataLoader…
pwernicke Oct 8, 2024
955d2c5
Updated dependencies
glen-84 Oct 9, 2024
b86114e
Fixed grammatical error
glen-84 Oct 9, 2024
3842b9b
Corrected link
glen-84 Oct 9, 2024
594e15a
Renamed Banana Cake Pop to Nitro
glen-84 Oct 9, 2024
509dcfc
Added DataLoader projections (#115)
glen-84 Oct 14, 2024
8d3083b
Updated dependencies
glen-84 Oct 17, 2024
a22f2f3
Updated dependencies
glen-84 Nov 12, 2024
c88d828
Updated dependencies
glen-84 Dec 10, 2024
37956fb
Updated dependencies
glen-84 Feb 11, 2025
e6c98aa
Updated dependencies
glen-84 Mar 20, 2025
34784a5
Updated dependencies
glen-84 Mar 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.cs]
indent_size = 4
313 changes: 4 additions & 309 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,310 +1,5 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Ignore website as we do not have it in 11
website/

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# Visual Studio code coverage results
*.coverage
*.coveragexml

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf
*.ndf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/

# Typescript v1 declaration files
typings/

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
__MISMATCH__/
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config

# Telerik's JustMock configuration file
*.jmconfig

# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs

lcov.info
coverage.json
.DS_Store

BenchmarkDotNet.Artifacts
.sonarqube/
.testresults

# Build related
tools/**
!tools/packages.config
!tools/Build.sln
!tools/Build.Core.sln

testoutput/
artifacts/
__mismatch__
conferences.db
*.DotSettings.user
bin/
obj/
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"EditorConfig.EditorConfig",
"streetsidesoftware.code-spell-checker"
]
}
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,34 @@ If you want to browse the GraphQL server head over [here](http://workshop.chilli

## Prerequisites

For this workshop we need a couple of prerequisites. First, we need the [.NET SDK 5.0](https://dotnet.microsoft.com/download/dotnet/5.0).
For this workshop we need a couple of prerequisites. First, we need the [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0).

Then we need some IDE/Editor in order to do some proper C# coding, you can use [VSCode](https://code.visualstudio.com/) or if you have already on your system Visual Studio or JetBrains Rider.
Then we need an IDE/editor in order to do some proper C# coding, you can use [VSCode](https://code.visualstudio.com/) or if you already have it on your system, Visual Studio or JetBrains Rider.

Last but not least we will use our GraphQL IDE [Banana Cake Pop](https://chillicream.com/docs/bananacakepop).
Last but not least we will use our GraphQL IDE [Nitro](https://get-nitro.chillicream.com).

> Note: When installing Visual Studio you only need to install the `ASP.NET and web development` workload.

## What you'll be building

In this workshop, you'll learn by building a full-featured GraphQL Server with ASP.NET Core and Hot Chocolate from scratch. We'll start from File/New and build up a full-featured GraphQL server with custom middleware, filters, subscription and relay support.
In this workshop, you'll learn by building a full-featured GraphQL Server with ASP.NET Core and Hot Chocolate from scratch. We'll start from File/New and build up a full-featured GraphQL server with custom middleware, filters, subscriptions, and Relay support.

**Database Schema**:

![Database Schema Diagram](docs/images/21-conference-planner-db-diagram.png)
![Database Schema Diagram](docs/images/21-conference-planner-db-diagram.webp)

**GraphQL Schema**:

The GraphQL schema can be found [here](code/complete/schema.graphql).
The GraphQL schema can be found [here](code/session-7/GraphQL.Tests/__snapshots__/SchemaTests.SchemaChanged.graphql).

## Sessions

| Session | Topics |
| ----- | ---- |
| [Session #1](docs/1-creating-a-graphql-server-project.md) | Building a basic GraphQL server API. |
| [Session #2](docs/2-controlling-nullability.md) | Controlling nullability. |
| [Session #3](docs/3-understanding-dataLoader.md) | Understanding GraphQL query execution and DataLoader. |
| [Session #4](docs/4-schema-design.md) | GraphQL schema design approaches. |
| [Session #5](docs/5-understanding-middleware.md) | Understanding middleware. |
| [Session #6](docs/6-adding-complex-filter-capabilities.md) | Adding complex filter capabilities. |
| [Session #7](docs/7-subscriptions.md) | Adding real-time functionality with subscriptions. |
| [Session #8](docs/8-testing-the-graphql-server.md) | Testing the GraphQL server. |
| Session | Topics |
|------------------------------------------------------------|----------------------------------------------------|
| [Session #1](docs/1-creating-a-graphql-server-project.md) | Creating a new GraphQL server project. |
| [Session #2](docs/2-understanding-data-loader.md) | Understanding DataLoader. |
| [Session #3](docs/3-schema-design.md) | GraphQL schema design approaches. |
| [Session #4](docs/4-understanding-middleware.md) | Understanding middleware. |
| [Session #5](docs/5-adding-complex-filter-capabilities.md) | Adding complex filter capabilities. |
| [Session #6](docs/6-subscriptions.md) | Adding real-time functionality with subscriptions. |
| [Session #7](docs/7-testing-the-graphql-server.md) | Testing the GraphQL server. |
Loading