GraphQL API with .NET 5 and Hot Chocolate
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they were following when asking about Hot Chocolate and Entity Framework errors in GraphQL projects.
Recommended by 0 people across 0 different months, 2021 to 2024.
What it is
A nearly four-hour tutorial by Les Jackson (Binary Thistle) that builds a GraphQL API with C# 9, .NET 5 and the Hot Chocolate framework. It covers GraphQL concepts, queries, pooled DbContext factories, sorting and filtering, mutations, and subscriptions over WebSockets.
What people said
Cites Dikesh Kumar · 2021-10 · Stack Overflow · on “GraphQL : Not Getting EF Related objects after implementing Types”
For background, I am following the tutorial here: [this video] . As the code is too long I am putting that in git [LINK] Now, coming to the problem, when I am making request with this body query{ platform{ id, name, commands{ howTo } } } I am getting the data for platform with commands value as null and the below error: { "message": "There was no argument with the name `platform` found on the field `commands`.", "locations": [ { "line": 5, "column": 5 } ], "path": [ "platform", 1, "commands" ], "extensions": { "fieldName": "commands", "argumentName": "platform" } If I remove the type it's working fine, but if I add type then the problem occurs to get related objects.
Cites Jeremy · 2021-10 · Stack Overflow · on “There was no argument with the name `...` found on the field `...`”
I'm also facing this issue in this tutorial [this video] :/ I tried debugging, and it seems like the resolver is not being used
Cites jwize · 2022-03 · Stack Overflow · on “How to generate C# scripts from GraphQL properly with Strawberry Shake in a Blazor Project”
I am using a .NET Core 5 & Blazor together. I have also created a nice simple GraphQL API. But to start I just followed the tutorial Getting Started With Strawberry Shake and Blazor [LINK] . By the way, the version of Strawberry Shake is 12.7.0. I followed the tutorial perfectly but I can't get the scripts to generate properly. 1. dotnet new tool-manifest 2. dotnet tool install StrawberryShake.Tools --local 3. dotnet new sln -n Demo 4. dotnet new wasm -n Demo 5. dotnet sln add ./Demo 6. dotnet add Demo package StrawberryShake.Transport.Http 7. dotnet add Demo package StrawberryShake.CodeGeneration.CSharp.Analyzers 8. dotnet add Demo package Microsoft.Extensions.DependencyInjection 9. dotnet
Cites kamil · 2024-02 · Stack Overflow · on “Unable to create a 'DbContext' of type ''. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[Comm”
I'm following a video on GraphQL ( min 1.28.22 [this video] ), and when I run the command "dotnet ef migrations add AddPlatformToDb", it returns the following issue: Unable to create a 'DbContext' of type ''. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[CommanderGQL.Data.AppDbContext]' while attempting to activate 'CommanderGQL.Data.AppDbContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see [LINK] Despite writing the same things, it doesn't create any issues in the video. CommanderGQL.csproj : <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetF