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
HotChocolate merge two services that have the same schema
I'd like to use HotChocolate to create an API composition gateway stitching GraphQL from multiple services. This works great when each service has their own schema. However, I also have a case that two services are serving up items with the same…

EJHewy
- 564
- 4
- 7
1
vote
2 answers
Migrating to Openiddict 4.0.0 breaks HotChocolate GraphQL authorization for client credentials flow if token encryption is enabled
I've an ASP.NET Core project which hosts both an identity server using Openiddict and a resource server using HotChocolate GraphQL package.
Client-credentials flow is enabled in the system. The token is encrypted using RSA algorithm.
Till now, I had…

Sk Shahnawaz-ul Haque
- 544
- 8
- 17
1
vote
0 answers
The LINQ expression could not be translated but only for some fields
I have posted the issue to HC directly, but hoping to get some help from SO: https://github.com/ChilliCream/graphql-platform/issues/5827
I've added AutoMapper to our HC 12 + EF Core 7 project to complicate things a bit more. After lots of self…

Poat
- 327
- 1
- 11
1
vote
0 answers
Filtering a complex status column
I work with a GraphQL (HotChocolate) API that use EF Core to fetch data from my MS SQL Server.
A few entities have status columns, that are currently created on-demand with a complex query which can be translated to SQL with EF Core.
The status is…

bealtis
- 23
- 5
1
vote
1 answer
Expression Property by string
I haven't worked with expressions that much, I am trying to reference an Expression property by string name but I cam getting this error:
c# The member expression must specify a property or method that is
public and that belongs to the type…

THE AMAZING
- 1,496
- 2
- 16
- 38
1
vote
1 answer
How to handle serialization of Guid values in GraphQL using HotChocolate.AspNetCore? Id field being returned as base64 encoded string instead of Guid
I am using version 12.16.0 and I am facing an issue with the Id field being returned as base64 encoded string instead of Guid. Is there a way to configure a custom serializer or scalar type for Guid values in the schema?
The ID is stored as a Guid…

Mohammad Al Mahamid
- 11
- 1
1
vote
1 answer
Detect and handle when StrawberryShake Subscription connection wasn't successful
I have two asp.net applications running locally in development mode. One is running HotChocolate as the GraphQL server and working well. The second application is attempting to run StrawberryShake GraphQL client and access a subscription.
The…

Icode4food
- 8,504
- 16
- 61
- 93
1
vote
1 answer
GraphQL Hotchocolate one schema with EF Core and several databases
We want to create one GraphQL schema using EF Core and Hotchocolate. Our data is in several databases two Azure SQL and one PostgresQL. In the first DB we have descriptive data and in other two real-time pricing data from different data vendors. We…

George
- 11
- 2
1
vote
1 answer
How to override the filtering LINQ query generated by HotChocolate?
I have a case where I need to send tens of thousands of ids to the graphql server in the filtering query.
The query now generated by the HT is something like this:
_dbContext.
Forms
.Where(c=>staticLiistOfIds.Contains(c.Id))
.Select(c=>new…

Mahamad Husen
- 229
- 1
- 13
1
vote
1 answer
Add header to QueryRequestBuilder Graphql Hot Chocolate
I'm trying to testing my web Api with Graphql Hot Chocolate. I read documentation of ChilliCream https://chillicream.com/blog/2019/04/11/integration-tests but I have a doubt. Some endpoints use Authorization based of JWT, and I need to send it on a…

Allan
- 45
- 3
1
vote
0 answers
Using a AddPooledDbContextFactory with AspNetCore.Identity and Dataprotection
My issue is fairly similar to this question: Using AddPooledDbContextFactory with AspNetCore.Identity. But while it helped my issue is not the same.
I have an API that uses Duende IdentityServer and AspNetCore.Identity. I use dataprotection to…

Dylan Snel
- 671
- 2
- 7
- 26
1
vote
1 answer
How to encrypt the body of a request with GraphQL and Hot Chocolate
I have to implement an API using GraphQL with C# and Hot Chocolate.
One of the requirements is that the body of the request must be encrypted.
For instance, if I call my "Hello World" service with this body:
query{
hello(name:…

Andre
- 43
- 4
1
vote
1 answer
Modifying variable values in a Mutation in a HotChocolate request middleware
Is there a good way to modify the input from a mutation using a Request Middleware in HotChocolate? We want to sanitize the data that is entered through free text input fields in order to migitate XSS attacks.
After some research I found out that if…

KrisMale
- 11
- 1
1
vote
1 answer
How to implement GraphQL schema stitching with authentication for microservices in .NET Core 6
How we can pass auth token to micro services when we use GraphQL schema stitching with authorization for micro services in .NET Core 6 Hotchocolate?

Samad Kakkad
- 53
- 4
1
vote
0 answers
How to test an Attribute in Hot Chocolate
Using Hot Chocolate, how do I integration test the implementation of a ObjectFieldDescriptorAttribute?
Given the following implementation:
public class ValidApiKeyAttribute : ObjectFieldDescriptorAttribute
{
public override void…

sjokkogutten
- 2,005
- 2
- 21
- 24