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
0
votes
1 answer
Dynamic graphql schema from json object
I am working on a multi-tenant SAAS application using efcore and graphql using hot chocolate as graphql server, where each tenant can define some custom fields/columns.
For instance, a tenant can add a column Email in customer entity, while another…

Krishna Sarthi
- 73
- 1
- 7
0
votes
0 answers
How to implement generic query using GraphQL/HotChocolate in C#
We have multiple classes/entities and wants to implement single query for all these types. Basically we want to implement a Query something like this.
public class Query
{
private readonly IGenericRepository…

Oxygen
- 831
- 4
- 17
- 42
0
votes
0 answers
Hotchocolate pagination and projection when mapping to a different type than the entity itself
I have the situation where my query does not directly return the the entity type, it is being mapped to another type by a mapping method. I am using the [UsePaging] attribute and I notice that the SQL resulting from the query does not include a 'TOP…

Colin Smith
- 1
- 2
0
votes
2 answers
HotChocolate GraphQL with Nullable Reference Types disabled
I'm trying to learn how to use HotChocolate and GraphQL as an alternative to REST APIs. Now my project does not allow implicit nullable reference types so when I have a model I need a constructor to set every of my properties that aren't nullable to…

Giani Noyez
- 481
- 3
- 8
- 17
0
votes
1 answer
Why "DatetimeOffset" is coming up as "DateTime" in HotChocolate GraphQL Schema?
I am using Hot Chocolate graphQL with .NET. In my Dto, I have one DatetimeOffset field but when I see the schema on UI, I see DateTime. I see the same even if I use [GraphQLType(typeof(DateTimeOffset))] or [GraphQLType(typeof(DateTimeOffset?))].
How…

GThree
- 2,708
- 7
- 34
- 67
0
votes
0 answers
GraphQL query has errors : C#
I'm using HotChocolate to create a GraphQL service in .net6.
Having this type
public class OrderPrjectionType : ObjectType
{
protected override void Configure(IObjectTypeDescriptor descriptor)
{
…
user21594491
0
votes
1 answer
hotchocolate authorization not working with .net core
I have created an GraphQL api with .net core and entity framework and now I want to set up the [Authorize] attribute to some of my methods.
Without this attribute it works all fine, I can execute my queries and everything, but as soon as I put…

questioner9928
- 21
- 5
0
votes
0 answers
Handling GraphQL Query Errors. Blazor Asp.Net Core 7
Been having issue receiving errors on my Blazor client that occur during a graphql query on my Blazor Server. Using an error filter, when an exception is thrown during execution on the server side the error is added to Errors.
Banana Cake Pop…
0
votes
0 answers
How do I filter by just day in dateTime type .net using graphQL?
*{
clicks(
where: {
id: { eq: 1 }
date: {day: {eq : 25}}
}
)
{
id,
date
}
}*
I'm trying to get all clicks which where the day is equal to 25 (date is datetime…
0
votes
0 answers
Access Hot Chocolate GraphQL filter values to transform into Odata filter
Overview
I have a few GraphQL endpoints in different projects, and most of them use Entity Framework.
We have a mix of HC 10 and HC 12 projects. In these we use HC filtering and it works great - the GraphQL queries are translated naturally into SQL…

Poat
- 327
- 1
- 11
0
votes
1 answer
Websocket connection to Hot Chocolate GraphQL server fails in local environment
Hello Hot Chocolate Community,
I'm having trouble setting up websockets for my Hot Chocolate GraphQL server in my local environment. I have followed the documentation and added app.UseWebSockets() to my ASP.NET Core application, which is running on…

David Marquardt
- 84
- 2
- 11
0
votes
0 answers
Does Hot Chocolate graphql-platform have CLI to auto generate resolver code based on Schema.graphql?
Does Hot Chocolate graphql-platform have CLI to auto generate resolver code based on Schema.graphql what people commonly refers as schema-first
This is the closest answer I found to the question I have whether hot-chocolate support auto-generated…

iwan
- 7,269
- 18
- 48
- 66
0
votes
1 answer
Why am I getting "resolver is not an iterable type like IEnumerable, IQueryable, IList " error in GraphQl Pagination?
I am using a wrapper to return an API response where Error is a type of ICollection. I am getting the following error from Hot Chocolate and trying to understand that. This is a straightforward operation where I am returning a list based on…

GThree
- 2,708
- 7
- 34
- 67
0
votes
0 answers
Is it possible to use dataLoader with multiple keys in GraphQL?
For GroupDataLoader by Hot Chocolate, you can only pass 1 key in .LoadAsync(). I think it is same for BatchDataLoader as well but I am intrested in group data loader.
If we go by use cases then Group Data Loader works if I am doing look up using one…

GThree
- 2,708
- 7
- 34
- 67
0
votes
1 answer
What is the best approach to use filter on GraphQL queries?
I am trying to understand what is the best approach to utilize query with filters in GraphQL for my scenario.
So far what I have learned is, GraphQL does not have filter concept. UI/Consumer can fetch records per their need. I have GroupDataLoader…

GThree
- 2,708
- 7
- 34
- 67