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
1
vote
1 answer

HotChocolate GraphQL (.NET Core) How to drill down nested Classes

I am new to GraphQL. I am testing HotChocolate following a simple article and seems that was easy to drill down to nested classes using [UseSelection] annotation in the Resolvers, however, I am using V11 and I realize did no work anymore, I would…
Paulo Amf
  • 360
  • 3
  • 14
1
vote
1 answer

HotChocolate apply UseFiltering for a field along with Resolver in QueryType

I have an issue with using resolver with UseFiltering() method in query type. At the moment, I'm using resolver for all fields in Query type. I don't know if this is best practice or not. I'm going to illustrate scratch codes. public class QueryType…
Triet Nguyen
  • 763
  • 9
  • 20
1
vote
1 answer

HotChocolate: How to bind directive to field from resolver with [ExtendObjectType]

Imagine this ObjectType with field "bars" from FooResolver annotated with BazDirective public class FooResolver { public IEnumerable GetBars(string name) {/*omitted*/} } public class FooType: ObjectType { …
1
vote
2 answers

Is there anyway to add services to the service provider at runtime? Or rebuild it? On .NET 5.0 or .NET core 3+

I have a multitenant application on a micro service architecture design. I want to inject X number of services, depending on the number of tenants running. public void ConfigureServices(IServiceCollection services) { // ... OTHER DI …
1
vote
1 answer

There is no object type implementing interface `IAddress`. (HotChocolate.Types.InterfaceType)

1. There is no object type implementing interface `IAddress`. (HotChocolate.Types.InterfaceType) at HotChocolate.Configuration.TypeInitializer.Initialize(Func`1 schemaResolver, IReadOnlySchemaOptions options) …
AnilkumarReddy
  • 135
  • 1
  • 13
1
vote
1 answer

Correct place to audit query in Hot Chocolate graphql

I am thinking should I audit user queries in HttpRequestInterceptor or DiagnosticEventListener for Hot Chocolate v11. The problem with latter is that if the audit failed to write to disk/db, the user will "get away" with the query. Ideally if audit…
Jason
  • 13
  • 3
1
vote
1 answer

Using Automapper 10.1.1 and HotChocolate 11.1 to map queryables

I am trying to project my EF Core queries with Automapper to allow an 3rd layer in my application but I have some trouble allowing HotChocolate to request fields on my DTO and telling Automapper to include those fields in the projecting…
Venson
  • 1,772
  • 17
  • 37
1
vote
0 answers

HotChocolate Stitching How to remove argument from a mutation?

I have an GraphQL api implemented using HotChocolate 11. The schema changed recently and I would like to use our stitching layer to keep it the same for clients. I have an mutation that looked like this: type Mutation { generate(apertures:…
1
vote
2 answers

Lazy loading data in Dapper using HotChocolate GraphQL

I have a problem using GraphQL with the HotChocolate library in a C# backend. When I use filtering the whole table is loaded and after that it is filtered. This of course means an awful performance as a full table scan is performed each time. This…
gallargit
  • 11
  • 2
1
vote
2 answers

Filter EF Core Navigation property on GraphQL HotChocolate

I am using HotChocolate (11.2.2) with EF Core and want to filter a sub property. According to the GraphQL docu this should be possible by using the filter keyword on the navigation property but HotChocolate just fails. My schema: type A { Name:…
Venson
  • 1,772
  • 17
  • 37
1
vote
0 answers

.Net Core Hot Chocolate Schema Stitching

The are currently using an ASP.Net Web Api as a gateway for our other graphql microservices. We are using Hot Chocolate 10.5.2 to stitch together all the schema definitions. Most of our schemas work fine; however, when we attempt to to stitch a…
Mennis
  • 11
  • 2
1
vote
1 answer

Non nullable types by default in HotChocolate.AspNetCore

Is there any way to make types (strings or custom class types) non nullable by default and if I need to, then make them nullable using some kind of "NullableType" in attributes or by descriptor?
Chameleon
  • 23
  • 3
1
vote
2 answers

HotChocolate resolve and async

I'm using HotChocolate with Entity Framework. For some fields, we want to filter One-to-Many collections. Example : public class Many { public int Id { get; set; } public string? Name {get; set; } } public class User { public int Id {…
Yann
  • 1,388
  • 2
  • 11
  • 9
1
vote
1 answer

AddPooledDbContextFactory with DbContext that uses custom DbConnection: service not registered

I have a custom DbContext SnowflakeDbContext that I need to initialize with a SnowflakeDbConnection for it to work: public class SnowflakeDbContext : DbContext { private readonly string connectionString = ""; public…
1
vote
1 answer

Extending types with ObjectType field

I'm new to HotChocolate and GraphQL, and I have some difficulties with type extension. Is it possible to extend type with ObjectType field? I've found only one example in the documentation with StringType: protected override void…