Questions tagged [hotchocolate]

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.

393 questions
0
votes
1 answer

Unable to use filtering on custom fields in Hot Chocolate

I am still (or again) on my student project and one part of the project is the ability to send and view (of course) messages between users, and we use HotChocalte (.Net 5.0) for queries (read) and mutations (send). Data are usually obtained from a…
Willy K.
  • 397
  • 2
  • 14
0
votes
0 answers

How to start GraphQL server when running .net5 integration tests?

I believe I am missing/misunderstanding something fundamental about the way .net5 works. In setting up an integration test environment for my GraphQL API, I am missing the step on how to start the GraphQL server from said test environment. When I…
0
votes
1 answer

DataLoaderOptions.AutoDispatch in hotchocolate v11

I'm trying to migrate HotChocolate from v10 to v11, and facing a unit test problem. In order to test a dataloader load, I had this code which was working fine. var loader = new CompanySettingDataLoader(api, new DataLoaderOptions { …
0
votes
0 answers

hotchocolate (ChiliCream) different QueryTypes per request

From what I have seen the QueryType is built in the startup and stays static. from the documentation: public class Startup { public void ConfigureServices(IServiceCollection services) { services .AddGraphQLServer() …
Júlio Almeida
  • 1,539
  • 15
  • 23
0
votes
0 answers

Hotchocolate + Schema federation + GUID format crash

We have a gateway API with stitching on and the schema is pulled from a redis cache where underlying APIs push their schema to. When the APIs start, everything is fine - the underlying APIs push their schema to the cache and the gateway reads it. If…
vm2013
  • 304
  • 2
  • 14
0
votes
1 answer

Mocking Authentication in .Net with IRequestExecutor

Trying to write some integration tests for the first time in .NET - specifically for HotChocolate. I’ve got had tests working with the WebApplicationFactory, the final part left is trying to now mock the authentication. I tried to set it up based on…
Kieran Osgood
  • 918
  • 6
  • 17
0
votes
1 answer

How to intercept GraphQL Hotchocolate Banana Cake Pop Query in Resolver

Is there a way to intercept a query that is passed from the (BananaCakePop/Hotchocolate) playground and read the contents of it? Currently I am trying to use IHttpContextAccessor httpContext in my resolver which is injected after configuring my…
Harobed
  • 145
  • 1
  • 13
0
votes
1 answer

Hot Chocolate can't set default value for field of input type

I have a class with an enum field declared like this: public class PostPhotoInput { [DefaultValue(PhotoCategory.Portrait)] public PhotoCategory Category { get; set; } } I expect it to produce SDL that looks like this: input PostPhotoInput…
Anthony Bias
  • 515
  • 3
  • 20
0
votes
1 answer

.NET HotChocolate generic type pagination

with Hot chocolate platform, I created a response type for my lists: ListResponseBase(IQueryable Result, ResponseStatus status). Then I want to UsePaging for my query: ListResponseBase GetUsers(). but I got error message in schema building…
Sadeq Shajari
  • 21
  • 1
  • 4
0
votes
1 answer

Using existing objects as input in a mutation

I am building a graphql API using HotChocolate on ASP.NET. I have two types, role as well as permission. permission consists of an id, a name and a description. role is almost the same, but it contains a list of permission's. I have already figured…
0
votes
1 answer

Is there a way in hotChocolate to log the query which is performed on IQueryable

we use HotChocolate with MongoDB. I tried the ConsoleQueryLogger es explained in the documentation to log the graphql query. What I want now is to get also the query that is performed on a collection. Kind Regards
0
votes
1 answer

Dependency Injection of services for GraphQL

I'm using NET5 webapi with HotChocolate package and am trying to inject a service. I've followed both standard and method based approach documented here however it doesn't work at all. All i get is the following message: { "errors": [ { …
Aeseir
  • 7,754
  • 10
  • 58
  • 107
0
votes
1 answer

What is the Best Practice and Efficient way to organize Query, Mutation and Subscription classes in Hotchocolate GraphQL

which one is best and efficient way to organize query, mutation and subscription class? Partial class [ExtendObjectType(OperationTypeNames.Query)] others? And what is the difference, what is happening behind the scenes? In this official docs If we…
Abdullah
  • 3
  • 2
0
votes
2 answers

Why is my context disposed before I can use it?

I'm implementing a very simple query using the HotChocolate GraphQL library in a .Net 5 project. I've been following the tutorial series from the HotChocolate GitHub repository but in my project I don't want GraphQL accessing the context directly…
0
votes
1 answer

HotChocolate not mapping models properly to type

Hotchocolate does not appear to have mapped one of my models properly. I have this product search model: public class ProductSearchResponseModel : ISearchResult { public string Identifier { get; set; } public…
r3plica
  • 13,017
  • 23
  • 128
  • 290