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

How to define a nullable list with non-nullable items in a GraphQL schema using HotChocolate?

I'm using C# 10 but with nullable reference types disabled on .NET 6 and HotChocolate 12.12.0. My Query.cs has an entry like this: public async Task> GetFoos() { ... } The generated GraphQL schema looks like this: foos: [Foo] (nullable…
eddex
  • 1,622
  • 1
  • 15
  • 37
1
vote
3 answers

how to display enum number instead of enum name in response

When trying to get an answer using hotchocolate, in fields with enum type the answer is in the form of a string, and I need an enum value [UseProjection] public IQueryable GetActualCart([Service] ApplicationDbContext context,…
1
vote
1 answer

Hot chocolate Enum serialization issue in .NET core

When I request the data from banana cake pop I get the following error { "message": "EmployeeType cannot serialize the given value.", "extensions": { "code": "EXEC_INVALID_LEAF_VALUE" } } As per hot chocolate enum are serialized by…
luqman ahmad
  • 171
  • 1
  • 7
1
vote
1 answer

GraphQL Hot Chocolate Multiple Schemas

I have a really simple setup but wondering how do I register multiple queries? For example, this is my code so far: I guess my question is how do I access the GetAllMoviesQuery. When I enter https://localhost:7058/admin/graphql/ or…
Dr Schizo
  • 4,045
  • 7
  • 38
  • 77
1
vote
0 answers

Undefined error when rendering react component with data retrieved from GraphQL Apollo Client

I have the component above, which takes the ArtigoID params value from the URL and fetch it to a GraphQL endpoint. const DadosDoArtigo = () => { let { ArtigoID }: any = useParams(); const { data, loading } = useQuery<{ artigo:…
1
vote
1 answer

HotChocolate (GraphQL) ignore schema errors on query

I want to be able to "suppress" the default HotChocolate (server) behavior and ignore schema errors on query. Let me try to give example. Let assume we do have the following schema: type Query { myTypes: [MyType] } type MyType{ id: ID! …
pvv
  • 147
  • 10
1
vote
2 answers

ChilliCream Hot Chocolate - Any Way To Extend Object Type On A Method Level (Instead Of On A Class Level)

ChilliCream Hot Chocolate only allows the registering of one type for each graph QL operation on startup e.g. for the Query operation: public class Startup { public void ConfigureServices(IServiceCollection services) { services …
YungDeiza
  • 3,128
  • 1
  • 7
  • 32
1
vote
0 answers

How to access a pooled EF-CORE dbContext in a background service - .net core 6

I'm using HotChocolate Graphql in .net core 6 and it suggests using PooledDbContext, however, now I need to create a brackground service, but I can't inject the Db Context In the Background Services, it throws this exeption: Unhandled exception.…
1
vote
1 answer

Hot Chocolate Graphql Stitching - How to route the query / mutation based on variable value

We would like to route the queries / mutation to different endpoints with the same schema. I'm not sure if stitching is the way to go. But is someone can advise. Traffic will be routed through an Azure Api Manager, to the GraphQL Stitched Gateway,…
Sakkie
  • 136
  • 8
1
vote
0 answers

How to use a Directive on a Query argument in ChilliCream GraphQL

Scenario I am using .NET Core 6 and ChilliCream v12 I want to use a custom Directive on certain arguments of queries and mutations. I have been able to get Directives to work on fields of a Type but not on an argument of a Query/Mutation. Here is a…
Chris
  • 31
  • 3
1
vote
1 answer

ClaimsPrincipal in HotChocolate resolver not loading from the JWT

Evening all. I've been at trying to resolve some authorization/authentication issues with Blazor/HotChocolate/Azure AD B2C for a few days and I believe I have managed to nail it down to the following: public string GetMe(ClaimsPrincipal…
Lucas
  • 478
  • 4
  • 15
1
vote
1 answer

ASP.NET 6 HotChocolate SchemaStitching failure on remote schema fields

I'm trying to change the example of SchemStitching on GitHub to use it from a products service instead of a gateway service. The idea is to extend schema of the product and include information from inventory & reviews. The changes I make in the…
Mike
  • 561
  • 1
  • 5
  • 20
1
vote
0 answers

Dependency injection in Hotchocolate GraphQL, ASP.NET Core

Is it possible to do something like this? Query.cs class Query : ObjectType> where T : class { protected override void configure(IObjectTypeDescriptor> descriptor) { descriptor .Field(f =>…
1
vote
1 answer

.NET Core API with GraphQL and dynamic Dictionaries

I have a .NET Core API app that allow users to create models with specific schema (much like common Headless CMS). The models act as Template for contents. The content created on top of models are stored in NoSQL Database and the class that owns the…
Simone Belia
  • 253
  • 3
  • 10
1
vote
0 answers

Problem when querying with GraphQL embedded entities on CosmosDB EF Core 6

I'm trying to query with the following GraphQL query the CosmosDB using EF Core 6. { products { productId, productType, startDate, productInfo { brandName, productLine }, marketingData { localizations…
Peter
  • 483
  • 7
  • 16