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
2
votes
1 answer

In GraphQL HotChocolate can you have optional parameters or use a constructor?

I am using HotChocolate as a GraphQL server from my ASP.NET Core Api. The parameters of a request need to have an optional parameter, a Guid, however if the Guid is null then the model needs to generate a random Guid. public class MutationType :…
Tristan Trainer
  • 2,770
  • 2
  • 17
  • 33
2
votes
1 answer

How do I enable Apollo Tracing with Hot Chocolate for all query requests permanently?

When using Hot Chocolate with .Net Core I am creating my scheme like this: public class Startup { public void ConfigureServices(IServiceCollection services) { // Here I register my services / repositories; omitted for brevity …
Rafael Staib
  • 1,226
  • 12
  • 14
1
vote
1 answer

HotChocolate v.13 [UseProjections] attribute does not work with DataLoaders

I have the following GrapqhQL query: query { listTenants { totalCount items { tenantId name sites { totalCount items { siteId cmxName cmxState hosts( …
1
vote
0 answers

HotChocolate UseSorting doesn't work on computed fields

I have an ItemType defined with some custom fields that are resolved with ResolveWith: public class ItemType : ObjectType { protected override void Configure(IObjectTypeDescriptor descriptor) { descriptor …
1
vote
0 answers

hotchocolate schema stitching with another language server

I have a question for a custom scalar converter and schema stitching. I want to stitch a schema from a third party Server and from my own server. But the other server uses Java and a "BigDecimal" Type. And when I load the schema in "banana cake pop"…
Max
  • 200
  • 2
  • 13
1
vote
1 answer

HotChocolate v.13 DataLoader approach with attributes and source generated code not working

I recently started experimenting with HotChocolate v.13. and I am having issues implementing the data loaders with the [DataLoader] attributes like shown in this video: Let's simplify DataLoader with Hot Chocolate 13. I am using EF Core 6 and DB…
1
vote
1 answer

In Hotchocolate Graphql, not able to upload file using banana cake popup, getting server error

HotChocolateFileUploadError I am using Hotchocolate nuget package to implement GraphQL using Banana Cake Pop. I have implemented File upload using the UploadType. builder.Services .AddGraphQLServer() …
jone selas
  • 13
  • 2
1
vote
1 answer

SQL doesn't join necessary tables in HotChocolate pagination

I have the following entity Space that has a collection of SpaceMessage public class Space { public int Id { get; set; } [UsePaging(IncludeTotalCount = true, MaxPageSize = 50)] public ICollection Messages { get; set; } =…
Haohan Yang
  • 151
  • 1
  • 11
1
vote
0 answers

Hot chocolate - Filtering not working as expected

I am using hot chocolate filtering V13 and not getting desired result. i.e., I have a JSON as following: { "id": "b3d7768e-7a22-4109-9511-cdd17585267b", "createdDateTime": "2023-06-01T21:02:34.4800722+00:00", "earliestPaymentDate":…
GThree
  • 2,708
  • 7
  • 34
  • 67
1
vote
0 answers

How can I access the ID of the parent object inside a object entension

I have a class User with a property Id. I also have some binary data in my file system for each instance of that class - the names of the files are the Id of the object. I've written a type extension to provide a field with the text content from the…
Sven Erik
  • 63
  • 6
1
vote
0 answers

Closing websockets by apollo client react nextjs

I'm using Apollo Client with React, Next.js, and TypeScript to subscribe to a GraphQL server created with HotChocolate. While my subscriptions work correctly, I'm having trouble closing the WebSocket connections created by them. Even after…
1
vote
1 answer

Why am I not seeing all results after .Skip and .Take in LINQ for HotChocolate OffSetPagination?

On my Hot Chocolate GraphQl queries with OffSetPagination and leveraging skip and take for my query. I am noticing that skip and take filters works as expected on BE, but I am not seeing desired results either on playground or Postman. This is weird…
GThree
  • 2,708
  • 7
  • 34
  • 67
1
vote
1 answer

Querying an entity and its relationship using GraphQL

Given the following database schema: Table items title (string/varchar) ownerId (int/ForeignKey) // foreign key to users.userId Table users userId (int/PrimaryKey) username (string/varchar) Now, if I wanted to query all items including the…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
1
vote
1 answer

HotChocolate v13 schema test failed

I received the following error after upgraded HotChocolate GraphQL from v12 to v13 for schema testing. HotChocolate.SchemaException : For more details look at the Errors property. Unable to infer or resolve a schema type from the type reference…
1
vote
0 answers

The type of the member [foo] of the declaring type [bar] is unknown GraphQL/Hot Chocolate (again)

Greetings and thanks in advance. I am using .net6, GraphQL/Hot Chocolate/ChilliCream and have started my first test/GraphQL application. I wish to use some of the non-standard GraphQL types, uint for example. When the server starts up i get the…