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
0 answers

How do I infer ID fields in Hot Chocolate with EF Core?

I want my ID fields on the object types automatically infer that they contain ID types based on the information that can be obtained from entity configuration in EF Core. For example, say I define an entity Person in EF Core: public class Person { …
0
votes
1 answer

Why are there multiple DB calls with DataLoader?

Per my understanding, when I use DataLoader in GraphQL, it should hit DB once only with supplied key(s). This is regardless of the number of parallel calls. What am I doing wrong here? My scenarios: If I make 4 parallel calls with one ID then it is…
GThree
  • 2,708
  • 7
  • 34
  • 67
0
votes
1 answer

Using app.Environment in HttpRequestInterceptor?

In Program.cs I can use app.Environment.IsDevelopment() Now I have a custom HttpRequestInterceptor : DefaultHttpRequestInterceptor with a method public override ValueTask OnCreateAsync(HttpContext context, IRequestExecutor requestExecutor,…
0
votes
1 answer

Extending GraphQL Filter for Multiple Keyword Search

I am trying to extend GraphQL Filtering to query multiple words. E.g.: if parsedValue = "Tom and Jerry", then the contains should get me items that contain either 'Tom' or 'and' or 'jerry'. I am using ChilliCream HotChocolate .NET code for the…
Vondool
  • 25
  • 4
0
votes
1 answer

How to add a custom field to the Payload generated by AddMutationConventions()?

I am using AddMutationConventions() to save me from writing boilerplate code. However I want to add a field query: Query to each Payload. Is that possible in combination with AddMutationConventions() or do I have to write my own Payload by hand in…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
0
votes
0 answers

Error creating Maui app package: GraphQLDefRule rule is missing the "{ItemType}" property

I'm creating MAUI app using HotChocolate for GraphQL. Locally everything works ok. But when I'm trying to create App archive, I'm getting error: "Failed to create app. The "GraphQLDefRule" rule is missing the "{ItemType}" property. What should i…
Surikus
  • 33
  • 5
0
votes
0 answers

What is the correct approach to fetch cosmos records using .AddPooledDbContextFactory?

I am learning BatchDataLoader using Hot Chocolate. Per their guidelines, I am using .AddPooledDbContextFactory. Using Microsoft.Azure.Cosmos nuget package to support cosmos DB. Now, I am getting null when I'm trying to fetch Cosmos record with valid…
GThree
  • 2,708
  • 7
  • 34
  • 67
0
votes
0 answers

Can I use external GraphQL IDEs with HotChocolate?

I am learning GraphQL with .Net Core, Entity Framework Core and C#. So far, what I have learned is, if I use ISchema then it is very easy to integrate such IDEs. I have successfully integrated these IDEs, GraphiQL & GraphQL.Server.Ui.Playground. Now…
GThree
  • 2,708
  • 7
  • 34
  • 67
0
votes
1 answer

What is the best practise to make parallel calls on GraphQL query?

I am learning GraphQL using hotChocolate. I am trying to understand what is the best practice to achieve parallel calls on Query. Right now, I am playing with very small data (< 10 records) to learn basic concepts. But let's say tomorrow I have…
GThree
  • 2,708
  • 7
  • 34
  • 67
0
votes
1 answer

Exception when adding interface type that holds already registered types

Frontend developers are requesting an interface that holds all the types that are currently validatable in our system. I have created the following interface IValidatable public interface IValidatable { public AddressInput AddressInput { get;…
Slamdunk
  • 424
  • 1
  • 8
  • 20
0
votes
1 answer

How to force Hot Chocolate Graphql to use left join on null Id to stop under fetching?

I have an issue where the Sql generated from a Graphql request is using an inner join that is causing data to be skipped. This is because the join is happening on an id field that can be null. I have no control over the id field so I cannot just…
ZackR
  • 61
  • 1
  • 7
0
votes
0 answers

Add child node on root query for query types of domain services?

Lets assume I have one gateway service and two domain services A and B. Using graphql federation I would like to stitch them together to a unified graphql schema accessible via the gateway service. The domain service have the following query…
TorbenJ
  • 4,462
  • 11
  • 47
  • 84
0
votes
1 answer

HotChocolate GraphQL: how to set a type as nullable for the whole schema

Because of our business model we have a "wrapper" type that is implemented as a struct. The type can either hold some data or be "empty". When the struct holds some data, we want to send it as a string but when it is empty the value of the field…
fog
  • 3,266
  • 1
  • 25
  • 31
0
votes
1 answer

HotChocolate returns ignored field

I have a user object, where i have created an ObjectType to ignore the Password field as it is genearlly not a good idea to expose that in my API :) However HotChocolate still returns the password field in the response. Account.cs public class…
Androme
  • 2,399
  • 4
  • 43
  • 82
0
votes
1 answer

Hotchocolate 13: Mutation does not work with schema first approach

I am trying to use hotchocolate 13. I have declared a simple mutation as below and have used 'AddGlobalObjectIdentification' to configure relay schema. I have used schema first approach and the mutation looks like below SDL type Mutation { …
Snoke
  • 5
  • 4