Tag: hotchocolate
-
HotChocolate v13 GraphQL: how to get rid of “Input” suffix?
0 I’m building GraphQL API with C# and HotChocolate. The library adds "Input" suffix to type names which used as input arguments. I want to get rid of this behavior. And no, we’re not going to discuss why do I want this, and why it is a good practice (even if you really want to,…
-
Can Function Middleware and HotChocolate Middleware be used together?
0 Is it possible to use Function Middlewares and Hot Chocolate Middlewares to be used together when using Azure Functions in an isolated-process? For example: Consider Authentication middleware that is defined at a Function level via IFunctionWorkerMiddleware. When the function is triggered, the Authentication Middleware is triggered and if authentication succeeds, then passes the control…
-
Hotchocolate Filter by BsonExtraElements
0 We have next entity: public class Product { public Guid Id { get; set; } public string Name { get; set; } = string.Empty; [BsonExtraElements] public Dictionary<string, object?> AdditionalData { get; set; } = new(); } This entity can have many dynamic data that can be stored inside AdditionalData property. Using attribute BsonExtraElements we…
-
GraphQL disposed DataContext
0 When trying GraphQL in the Playground, I get the following error: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are…
-
GraphQL HotChocolate file upload
0 How can I make a mutation call from a client and upload a file? I can do it in the editor (screen) But I cannot figure out how to make the same from a client var request = new GraphQLRequest { Query = query, Variables = new { id = "id" }, }; var…
-
GraphQL + BananaCakePop won’t work in a Docker container
0 I’m creating a proof of concept with a GraphQL ASP.NET API and Hot Chocolate / BananaCakePop for web-based querying by local developers. It is just the most basic API at present with a single query point. I have the app running fine locally in VS but am having problems when I try to Dockerize…
-
Why the following graphql schema does not compile with HotChocolate?
0 I’m trying to put together a more complex stuff than Getting started guide with HotChocolate and I hit a wall, and the documentation does not help. I have multiple questions: What I’m doing wrong here? I went through all the examples they have and it seems I’m doing the right thing, but the error…
-
How can I implement a HotChocolate FieldResolver when the resolved value depends on another field?
0 I have the following code designed to apply a list of errors to resolved items by fetching the full list of errors from another service which that caches them for performance reasons: public class MyEntityExtensions : ObjectType<MyEntity> { protected override void Configure(IObjectTypeDescriptor<MyEntity> descriptor) { descriptor .Field("errors") .Type(typeof(List<Error>)) .Resolve(async context => { var errorCache =…
-
GraphQL Server – Addscoped (without explicitly specifying)
0 I am writing a graphql api using .net core+hot chocolate. I have to define all service names while creating graphql server. I have more than 20 service classes. Is there a generic way of specifying these services, I dont want to write 20 + lines of code to specify each service name. addscoped .net…
-
GraphQL Server – Addscoped (without explicityly specifying)
0 I am writing a graphql api using .net core+hot chocolate. I have to define all service names while creating graphql server. I have more than 20 service classes. Is there a generic way of specifying these services, I dont want to write 20 + lines of code to specify each service name. addscoped .net…