Tag: dictionary

  • Convert a comma separated string of fields to a GraphQL query syntax

    Convert a comma separated string of fields to a GraphQL query syntax

    -1 I have a requiremenet where I need to parse a user input comma separated string, and generate a graphql query out of it. INPUT: queryPath fieldA.fieldB, fieldA.fieldC, fieldA.fieldD.fieldE, fieldA.fieldD.fieldF, fieldA.fieldD.fieldG OUTPUT: query{ queryPath{ fieldA{ fieldB fieldC fieldD{ fieldE fieldF fieldG } } } } I’m using Java to do this, thanks in advance. EDIT:…

  • 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>)…