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
Testing for Hot Chocolate GraphQL in DotNet errors with Syntax Error
Ok so I am new to GraphQL so may be missing something here. However, when I am trying to write my tests for my queries, I am getting syntax errors which I just cannot work out. So starting from the top.
Here is my Domain Object and Context:
public…

DaRoGa
- 2,196
- 8
- 34
- 62
0
votes
1 answer
In .NET Hot Chocolate GraphQL is it possible to apply Custom Pagination while still using [UseProjection] middleware?
Though [UseProjection] middleware works out of the box, the default UsePaging seems to still apply Offset based selection in the backend SQLServer Query. I want to use the [UseProjection] provided by HotChocolate, but want to have customized cursor…

Jagdish Shetty
- 3
- 3
0
votes
1 answer
Hot Chocolate top-level properties from multiple sources
I have an entity (Customer) that needs to pull data from multiple sources. The schema looks roughly like this:
{
id: string
name: string
address: string
contact: string
status: string
}
The id, name and address come from an EF…

mortware
- 1,910
- 1
- 20
- 35
0
votes
1 answer
How can i receive a data from response using GraphQL and .NET
I need to get a text from response field (Banana Cake Pop) but don't get how to do it with GraphQL nuget. I've found code similar to
var graphQLClient = new GraphQLHttpClient("url", new NewtonsoftJsonSerializer());
…

Alexey Savelyev
- 21
- 5
0
votes
1 answer
`StringOperationFilterInput` was already registered by another type, when stitching a remote GraphQL schema in HotChocolate
I have a main GraphQL project which serves Books, and a secondary project which serves Movies, both including filtering. I'd like to add the secondary server's schema to the main one, so I can query for Movies on it by forwarding the query to the…

Orion
- 566
- 4
- 9
0
votes
1 answer
HotChocolate GrapQl Schema Stiching returns error code HC0018
I am building a small proof-of-concept project to see if we can use GrapQl on our services. The schema stitching feature looks really good and if we implement GraphQl, would really need it.
After looking at the docs and running their example locally…

Lucas
- 11
- 2
0
votes
1 answer
HotChocolate w/ EF6: getting an [System.ObjectDisposedException] exception
The title says it all and I can't figure out why.
Before You Response:
All methods all returning Tasks (not void) except for the EF overrides
All subsequent methods are running w/ await
I'm using Cosmos DB as my repo and EF Core 6
I've followed…

a11smiles
- 1,190
- 1
- 9
- 21
0
votes
1 answer
ASP.NET Core API with GraphQL request using HotChocolate in itself
In my ASP NET Core 6 api, we make a query with a query (SQL) using Dapper, typing a model and with the result return in some endpoint or use in some service, for example, a service that generates a PDF report and returns in a File on endpoint
In the…

Gabriel Santos Lemos
- 49
- 2
- 10
0
votes
1 answer
How to filter GraphQL query result by joined table column (field)
I am trying to filter GraphQL query result by joined table column (field).
Relationship between tables is Many-to-Many (with bridge table of course) and I want to filter Advertisements by the Cities related to them.
I am using C#, .NET 6.0 and EF…

Mackovic
- 37
- 8
0
votes
1 answer
Graphql and relationships
Let's consider the following pseudo entities:
cateogory
{
id
name
...
}
product
{
id
name
categories[] {
{id: 1, isDefault: false},
{id: 2, isDefault: true}
}
}
In other words product knows about…

Radek
- 37
- 5
0
votes
2 answers
Loading Nested Objects GraphQL
How do you load nested types? For example, I have fairly simple model that looks like:
public class Customer
{
public string CustomerId { get; set; }
public string Forename { get; set; }
public string LastName { get; set; }
…

Dr Schizo
- 4,045
- 7
- 38
- 77
0
votes
1 answer
.Net HotChocolate GraphQL Mutations pick from a list of stings like enum
I have a bunch of data, in a .NET GRaphQL API that are basically list of strings like
Public List avarageMessageSize = new List{
"Up to 5 KB",
"Between 5 KB and 4 MB",
Between 4 MB and 20 MB",
"20 MB and bigger"
};
When a new Entity…

Home of Creation
- 57
- 6
0
votes
1 answer
Where best to add filtering in GraphQL?
I understand a filter condition can be applied in a query e.g
query{
MyObject(where: {id: {eq: 1}}){
id
name
}
}
which would access the server side query:
[UseDbContext(typeof(dbContext))]
[UseProjection]
…

Ryn901
- 173
- 2
- 12
0
votes
1 answer
does dotnet Hotchocolate need AutoMapper(DTO)?
Does Hotchocolate need AutoMapper?
HotChocolate have [GraphqlIgnore] etc. annotation. I Wonder using hotchocolate need to create DTO and use automapper?

otter otter
- 97
- 7
0
votes
2 answers
Hot Chocolate GraphQL - How to resolve field that uses ignored field with projection
I have a data model ItemData as follows :
class ItemData
{
public string StartTime { get; set; }
public string EndTime { get; set; }
// other fields here
}
I would like to expose those two as a single field Duration like this. Without…

anuith
- 659
- 5
- 16