Building a service that supports GraphQL
There is no dotnet
new
project template for GraphQL, so we will use the ASP.NET Core Empty project template. Even though GraphQL does not have to be hosted on a web server because it is not tied to HTTP, it is a sensible choice to get started. We will then add a package reference for GraphQL support:
- Use your preferred code editor to add a new project, as defined in the following list:
- Project template: ASP.NET Core Empty /
web
- Solution file and folder:
Chapter12
- Project file and folder:
Northwind.GraphQL.Service
- Other Visual Studio 2022 options:
- Configure for HTTPS: Selected
- Enable Docker: Cleared
- Do not use top-level statements: Cleared
- Project template: ASP.NET Core Empty /
- In the project file, add a package reference for Hot Chocolate hosted in ASP.NET Core, as shown in the following markup:
<ItemGroup> <PackageReference...