Hot Chocolate is an open-source .NET GraphQL server platform developed by ChilliCream. Use this tag for questions about code written using Hot Chocolate or for queries concerning the official documentation.
Questions tagged [hotchocolate]
393 questions
1
vote
0 answers
Hot Chocolate GraphQL SyntaxNode
In the Hot Chocolate GraphQL, OnError method, i can see(in VS watch during debug) the SyntaxNode which show me the request body.how i get it value. because it is not available in IError. how i can get the value showing at SyntaxNode

Mudasser
- 29
- 2
1
vote
1 answer
GraphQL query is null
I'm using graphQL hot chocolate and need to fetch data.
I need to fetch data from Template that has Specs and in spec it contains AttributeType.
when i try to query the data, template and spec has values but AttributeType is null that should not…

Ocelot
- 203
- 3
- 11
1
vote
1 answer
How to hide fields for different graphql types which return the same type for GraphQL HotChocolate
I created 2 different methods using GraphQL HotChocolate which return the same object type. I need to hide different fields for each method. However, it does not happen when I look at the schema definition. This is an example for code first…

user2105030
- 831
- 1
- 7
- 7
1
vote
0 answers
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. By the way, the version of Strawberry Shake is 12.7.0. I followed…

jwize
- 4,230
- 1
- 33
- 51
1
vote
0 answers
Hotchocolate graphql not running as subgraph under Apollo Federation
I'm trying to add a hotchocolate 12 subgraph to my existing Apollo federation using .net 5.0. Unfortunately receiving
(node:27900) UnhandledPromiseRejectionWarning: Error: Couldn't load service definitions for "supplier" at…

killjoy
- 864
- 17
- 31
1
vote
0 answers
GraphQL StrawberryCake Unable to resolve service for type
I'm using StrawberryCake as GraphQL Client v12.6. I'm following their tutorial to getting started.
After use dotnet graphql init -n ConferenceClient
Then register DI in Startup as follows
services.AddConferenceClient()
…

Steve Lam
- 979
- 1
- 17
- 40
1
vote
1 answer
Nuget package is not compatible, but in the supported-list (StrawberryShake.Tools)
I got this message after creating a new .NET 5-project (in VS2019) and trying to install nuget-package StrawberryShake.Tools. This seems a bit strange, since it says both that it is and it isnt compatible with "net5.0…

Cowborg
- 2,645
- 3
- 34
- 51
1
vote
1 answer
dotnet ef core HttpContext.User.Claims doesn't match with JWT
here is my JWT.
My HttpContext.User doesn't match with JWT.
here my httpcontext:
Plese help me...
Program.cs:

otter otter
- 97
- 7
1
vote
0 answers
How to skip fields with default values in JSON response in HotChocolate/GraphQl
I want to remove fields from output JSON with default values (0, false) to reduce size of response, but can't find a way how to do it in HotChocolate/GraphQl.
I didn't find a settings to control it (JsonFormatter), "Optional" also not for this…

Pavel Samoylenko
- 491
- 7
- 14
1
vote
2 answers
HotChocolate (GraphQL) it is impossible include nested object without query calling
// Parent entity
public class Parent
{
public int Id {get; set;}
public int CurrencyId {get; set;}
public virtual Currency Currency {get; set;}
}
// Currency Entity
public class Currency
{
public int Id {get; set;}
public string Name…

Abu Tolib
- 13
- 4
1
vote
0 answers
Sort by resolved property in HotChocolate
Is it possible to sort by a resolved property in HotChocolate? A resolved property can be an arbitrary expression, even some LINQ expression, which I set up in an ObjectType-derived class:
descriptor
.Field("MyResolvedField")
…

Ricardo Peres
- 13,724
- 5
- 57
- 74
1
vote
1 answer
Make Strawberry Shake request from Blazor with or without credentials
In my Blazor app (which uses Azure B2C), I want to be able to call an endpoint whether the user is authenticated or not.
I've searched quite a bit, and everything I find says I should create two HttpClients (example), one for anonymous and one for…

Dan Friedman
- 4,941
- 2
- 41
- 65
1
vote
1 answer
Am I misunderstanding Projections in HotChocolate?
I cant seem to get Projections with HotChocolate working for GraphQl. According to the documentation Projections should prevent over-requesting of data from the DB, and help connect data in related tables. As a simple example I set up the…

ZackR
- 61
- 1
- 7
1
vote
0 answers
Does Hot Chocolate uses async EF calls to database when IQueryable [UseFiltering] attributes used
[UseFiltering]
public IQueryable GetUsers([ScopedService] DbContext context)
{
return context.Users;
}
When we use [UseFiltering], does Hot Chocolate use async EF methods to retrieve data ?

Ddd
- 113
- 2
- 15
1
vote
0 answers
Access value inside resolver function
I have nested entities say like as below,
public class TestA
{
public TestB TestB {get; set;}
public string ProjectNumber { get; set; }
}
public class TestB
{
public TestC TestC{ get; set; }
}
public class TestC
{
public double…

rocky
- 11
- 2