DEV Community

Discussion on: Get started with GraphQL and Entity Framework

Collapse
rahmanm profile image
rahman mahmoodi

Hi Michael,
Just to let you know that selection on the model property does't work anymore. E.g. I followed this exact tutorial and this bit doesn't work anymore: enrollments(where: { courseId: 1 })

query {
students(where: { lastName: "Bar" }) {
firstMidName
lastName
enrollments(where: { courseId: 1 }) {
courseId
course {
title
}
}
}
}

I am using the latest of asp.net core and the latest of Hot Chocolate as of today:

<PackageReference Include="HotChocolate.AspNetCore" Version="10.4.3" />
<PackageReference Include="HotChocolate.AspNetCore.Playground" Version="10.4.3" />
<PackageReference Include="HotChocolate.Types.Filters" Version="10.4.3" />
<PackageReference Include="HotChocolate.Types.Selections" Version="10.4.3" />
<PackageReference Include="HotChocolate.Types.Sorting" Version="10.4.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="3.1.4" />

The playground shows error and doesn't allow to execute the enrollment where clause:

"unknown arguments on field enrollments"

TA

Collapse
allieberezhnaya profile image
allieberezhnaya

That could be because of the paiging. The request which is needed in case of paging enabled (nodes added) -

query {
students(where: { OR: [{ lastName: "Bar" }, { lastName: "Baz" }] }) {
nodes {
firstMidName
lastName
enrollmentDate
enrollments (where: { courseId: 1 }) {
grade
course {
title
}
}
}
}
}