Defining GraphQL queries for EF Core models
Now that we have a basic GraphQL service operating successfully, let’s extend it to enable querying the Northwind database.
Adding support for EF Core
We must add another Hot Chocolate package to allow easy dependency service integration of our EF Core database context with GraphQL query classes:
- Add a package reference for Hot Chocolate integration with EF Core and a project reference to the Northwind database context project, as highlighted in the following markup:
<ItemGroup> <PackageReference Include="HotChocolate.AspNetCore" Version="13.5.1" /> <PackageReference Include="HotChocolate.Data.EntityFramework" Version="13.5.1" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\Chapter03\Northwind.Common.DataContext .SqlServer\Northwind.Common.DataContext.SqlServer.csproj" /> </ItemGroup...