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 in 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
- Workspace/solution file and folder:
Chapter11
- Project file and folder:
Northwind.GraphQL
- Other Visual Studio 2022 options:
- Authentication Type: None
- Configure for HTTPS: Selected
- Enable Docker: Cleared
- Enable OpenAPI support: Cleared
- Project template: ASP.NET Core Empty/
- In Visual Studio Code, select
Northwind.GraphQL
as the active OmniSharp project. - Add a package reference for Hot Chocolate hosted...