How can I have complex dictionary type attributes

How can I have complex dictionary type attributes


0

I’m using graphql/hotchocolate in my app and I have the following structure:


public record PriorInjury(IDictionary<Location, Injure>? Injuries)

public record Location(Enums.BodyPart BodyPart, Enums.Side Side, Enums.FrontOrBack FrontOrBack);

public record Injure(Enums.PainLevel Level, Enums.HowOftenInjureHurts HowOften, Enums.SinceWhenInjured Since);

This is my command:

public record AddInjuryCommand(PriorInjury? PriorInjury) : ICommand<Guid>;

This code is throwing:

InputObject `PriorInjurySortInput` has no fields declared. (HotChocolate.Data.Sorting.SortInputType<PriorInjury>)

I have no idea of what is this "PriorInjurySortInput", sorting is not really important for me, and I just wanted this to work, I did not see any examples of how to work with dictionaries in their documentation, so I have no idea about what to do.

Share


Load 7 more related questions


Show fewer related questions

0

Reset to default



Browse other questions tagged

or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *