I've only started learning GraphQL on .net platform. If input type object can contains property of interface type then how to configure it in HotChocolate library?
An example of model:
public interface ILocationFilter {
double Lat { get; set;}
double Lng { get; set;}
}
public class LocationFilter : ILocationFilter {
// ...
}
public class FilterModel {
public string Search { get; set; }
public ILocationFilter Location { get; set; } = new LocationFilter();
// ...
}
GraphQL Query example:
public class Query {
public IEnumerable<SomeModel> GetByFilter(FilterModel filter) {
// ...
}
}
Startup.cs example:
// ...
services.AddGraphQL(SchemaBuilder.New()
.AddQueryType<Query>()
.Create(),
new QueryExecutionOptions { IncludeExceptionDetails = true });
// ...
app.UseGrapQL();
// ...
Right now I get an exception "Unable to infer or resolve a schema type from the type reference Input: ILocationFilter".
BTW: If remove interface everything will be work.
What should I configure to correct working with properties of interface type?