1

Is it possible to sort by a resolved property in HotChocolate? A resolved property can be an arbitrary expression, even some LINQ expression, which I set up in an ObjectType<T>-derived class:

descriptor
    .Field("MyResolvedField")
    .Type<StringType>()
    .IsProjected(false)
    .Resolve((context, ct) => 
    {
        //definition goes here
    });

I tried to set up a SortInputType<T>-derived class and on the Configure method explicitly mention my resolved field as:

descriptor.BindFieldsExplicitly();
descriptor.Field("MyResolvedField");

But this always fails with an exception. Is this even possible at all? If so, how?

Ricardo Peres
  • 13,724
  • 5
  • 57
  • 74

0 Answers0