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
0 answers
hotchocolate (GraphQL) filter by extended schema (stitching)
Is it possible to 'filter' (where) by an extended schema in stitching file in graphQL?
For example:
{
contractSKUCost(where: { contractSKU: { products: { productId: 1}} }) {
items {
id
contractSKU {
id
products {
…

Water
- 1,114
- 1
- 15
- 31
0
votes
1 answer
How to change root activity name in .NET HotChocolate for Elastic APM using a CustomActivityEnricher?
I am trying to change the root activity name in .NET HotChocolate for Elastic APM by creating a custom activity enricher and overriding the CreateRootActivityName method.
public class CustomActivityEnricher : ActivityEnricher
{
public…

Y G
- 13
- 4
0
votes
1 answer
GraphQL filter by multiple values on nested object
I have a GraphQL API and want to filter the results based on the nested tag object. The object looks like this:
{
name
...
tags [
{
name
},
{
name
},
...
]
}
I now want…

TheBinaryLoop
- 16
- 3
0
votes
0 answers
Problem sending file as FormData to GraphQL HotChocolate server using fetch-api
I am trying to send form data to a graphql server using fetch-api
GraphQL API Upload Test

BrocadE
- 11
- 5
0
votes
0 answers
Custom type replacement with Hot Chocolate 12
My schema defines an Employee type that has 15 or so fields on it. It's then used multiple times in other areas:
type Employee {
active: Boolean!
name: String
id: Int!
...
}
type Room {
owner: Employee!
delegate: Employee
}
99% of the…

Gargoyle
- 9,590
- 16
- 80
- 145
0
votes
1 answer
Query dynamic schema using a JSON object - GraphQL .NET 6 PostgreSQL and HotChocolate
I need to develop a graphql server to query data directly from a JSON object. this JSON object is stored in a postgres database table as below.
This value field can be any JSON object. I don't have control over that. it's directly coming from a…

Buddhika Nelum
- 33
- 1
- 12
0
votes
0 answers
how the transaction works in hotchoclate while batching the request?
/graphql?batch=[query1,query2] we can do the batching like this in hotchoclate. How the transaction and rollback happening like this approach?
Transaction and rollback should be happen

Amith Thillenkery
- 71
- 6
0
votes
0 answers
Using GraphQL together with MongoDB and abstract classes throws an error while deserializing object
When I use GraphQL (hot chocolate) together with MongoDB and abstract classes, I receive the following error message:
An error occurred while deserializing the Resource property of class
MyClass:
Cannot create an instance of MySampleClass because…

BendEg
- 20,098
- 17
- 57
- 131
0
votes
0 answers
How to handle refresh tokens in HttpOnly cookies with Hot Chocolate (GraphQL)?
I have an Asp.Net Core 6 GraphQL API app. Server setup with Hot Chocolate and endpoints are served at localhost/graphql.
When a user logs in GraphQL resolver generates both - access and refresh tokens, and sends in response as HttpOnly cookies.
An…

Elshad Shabanov
- 483
- 10
- 17
0
votes
0 answers
Hot Chocolate how to query nested tree
I've set up a project using HotChocolate and Entity Framework. The query looks like this.
post -> comment -> comment...
fragment comment on CommentType {
id
creatorId
text
timeStamp
}
query {
posts {
edges {
…

bokobaba
- 21
- 1
- 3
0
votes
0 answers
Resolve single field from collection returned by delegated query HotChocolate GrapQL
I'm using HotChocolate GraphQL to implement schema federation, the basic setup is working.
I'm attempting to extend a type from one of our downstream services using a delegated resolver and the extend type syntax.
I have the following type defined…

cmpbedes
- 473
- 1
- 5
- 13
0
votes
1 answer
Receiving "xxxx is not a valid GraphQL type name. (Parameter 'value')" when brackets are present in SetPath for ErrorBuilder in HotChocolate 12
This is necessary as I need to show which array element is causing the issue.
This was working fine before in HotChocolate 10, but after upgrading to 12 this is breaking. I am running the following line and it is breaking with the error below…

Jacob Shaffer
- 43
- 1
- 8
0
votes
1 answer
GraphQl Hot Chocolate Filter on List
I have an entity which I am querying through GraphQL which contains a property defined as a List. This has a JSON Conversion on it so it is stored as a JSON String in the database but whenever its accessed is parsed back to a list.
A…

DaRoGa
- 2,196
- 8
- 34
- 62
0
votes
0 answers
HotChocolate merge entity filter
I use for my ASP.NET Web API HotChocolate as a GraphQL Server, which generates filter based on the Entity used on the Query.
The project use an old DB schema, which is way outdated and can't/shouldn't be used anymore, therefore, we want to slowly…

bealtis
- 23
- 5
0
votes
1 answer
Hot Chocolate: filtering with a char field
How can I set up Hot Chocolate filtering to work when a class has a char field?
I have a class with a Status field of type char. Strangely, it seems that Hot Chocolate does not work with char fields. To get it to even generate a schema I had to…

Bennett McElwee
- 24,740
- 6
- 54
- 63