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
I cant access the desired attribute of the object in .net core
I am trying to implement Authorization in my .Net Core web api and after setting up my program.cs and after "decorating" the desired method with the [Authorize("ArchiveList")] I am having problems with handling the request in my HandleRequirement…

leoxrmd
- 17
- 2
0
votes
0 answers
Intercept the paginated response in hotchocolate
I have 2 separate collections one which stores all users and the other which has all the details and metadata. I am having an endpoint in hotchocolate which gives a paginated response of users details. Querying the user collection and having it as a…

user2842284
- 29
- 1
- 7
0
votes
1 answer
How to Implement Global Filters for Soft Delete in MongoDB Integration to Exclude Deleted Records from Queries?
Is there a way to implement global filters using the MongoDb integration for HotChocolate when all my types allow soft delete? Soft delete means marking the record to be deleted by setting the “IsDeleted” field to true, and then completely removing…

Cuban coffee
- 294
- 5
- 14
0
votes
1 answer
ChillyCream HotChocolate GraphQL with AnyApp.FluentValidation How to properly validate existance of entities
So Basicly the code below represents my project.
public class Mutation
{
public Guid CreateBook(
[Service] IBookService service,
[UseFluentValidation, UseValidator] CreateBookInputModel inputModel
…

Remon Lucassen
- 21
- 2
0
votes
0 answers
Getting "Could not load 'HotChocolate.Types.Descriptors.ITypeReference'" when attempting to create unit tests for C# unit test project
I'm trying to create units test for our graphql C# Function Application. I've started following along with the video from the Chilicream website on how to create the tests, but I cannot seem to get past the first part he does in his video…

Rob M
- 1,007
- 2
- 17
- 38
0
votes
1 answer
Why does the access token not expire in GraphQL Hot Chocolate "Banana Cake Pop"?
I expect to get a 401 error after token expiration, but it only happens after a long time...
What am I doing wrong?
I set ValidateLifetime: true.
Auth registration
public static class Registrar
{
public static IServiceCollection AddJWT(
…

Neomaster
- 166
- 1
- 7
0
votes
1 answer
Changed lifetime in Hot Chocolate after inheritance leads to disposed context
I have a legacy REST API, where I want to use its repository for my new Hot Chocolate API.
To use best practices I followed the guide here to set up my repository with a pooled context.
When I do not use the async dispose, everything works fine, but…

dohlenaugur
- 71
- 5
0
votes
2 answers
GraphQL proxy for .NET
I want to be able to have a GraphQL API (.NET) that will accept any request and then forward it to another GraphQL API. Is it possible to do this in some simple manner? Reason for it is that the first API will be adding some additional headers to…

Branislav B.
- 509
- 7
- 21
0
votes
0 answers
Global explicit binding behaviour not working with Hot Chocolate 13 ASP.Net
I have a project, where I use Hot Chocolate for a GraphQL API.
I create everything like this:
private static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// graphQL ---
var…

dohlenaugur
- 71
- 5
0
votes
1 answer
HotChocolate Authorization exception on test project
I'm getting the following error message when testing queries on a test project:
"The feature Authorization is missing the state with the key HotChocolate.Authorization.UserState"
My TestExecutorHelper has the .AddAuthorization() and…

Miguel Morgado
- 50
- 6
0
votes
2 answers
HotChocolate GraphQL contains-query on nullable string field results in null reference exception
In our .NET 6 project with Entity Framework Core, we use HotChocolate GraphQL 12.18.0.
To support case insensitive contains select queries on string fields, I added a custom field handler:
public class QueryableStringInvariantContainsHandler :…

MatterOfFact
- 1,253
- 2
- 18
- 49
0
votes
0 answers
Is Dependency Injection in a Hot Chocolate Web Application static, or per-instance?
I have a general architectural enquiry about Hot Chocolate. I'm hoping the answer may tell me whether I've made incorrect assumptions or have taken a wrong turn somewhere else.
I am building a simulation system providing stateful generated data for…

Andrew Matthews
- 3,006
- 2
- 29
- 42
0
votes
1 answer
Hot Chocolate resolver for a single item out of a list using EF Core
I'm new to using GraphQL/Hot Chocolate and I've been struggling with something that I hope someone here can help me with. I'm going with the code-first approach using F#. I have a type called Employee that has a one-to-many relationship with…

abaga129
- 887
- 1
- 9
- 12
0
votes
1 answer
Hotchocolate get current instance id in resolver
I have a domain entity Poll:
public class Poll
{
public int Id { get; set; }
public ICollection Questions { get; set; }
}
I want to add a new resolver to the Poll called "userHasAnswered" that is whether the logged in user has…

Cameron Cheung
- 197
- 1
- 2
- 12
0
votes
1 answer
Schema Stitching - chillicream - mutation
i want to use schema stitching, but i have problem with mutation extend, maybe with passing argument.
my following code for schema stitching
extend type Mutation {
space(value: SpaceInput): Int! @delegate(schema: "matterport", path: "space(value:…

Patrik Urban
- 1
- 1