Repository navigation
Closed
Labels
Area: AOT🌶️ hot chocolate🔍 investigateIndicates that an issue or pull request needs more information.
Description
Is there an existing issue for this?
- I have searched the existing issues
Product
Hot Chocolate
Describe the bug
When configuring an inheritance model using an Annotation-based strategy, Analyzers does not correctly generate the IRequestExecutorBuilder extension.
Steps to reproduce
Configuring the following
[InterfaceType]
public abstract class StatementTransaction
{
public int Id { get; set; }
public DateTime StatementDate { get; set; }
public StatementTransactionStatus Status { get; set; }
public StatementTransactionType Type { get; set; }
}
public sealed class DepositStatementTransaction : StatementTransaction
{
public decimal CollectionAmount { get; init; }
}
public sealed class BillingStatementTransaction : StatementTransaction
{
public decimal FeeAndChargeAmount { get; init; }
}
Result:
public static class FeeDepositReportTypesRequestExecutorBuilderExtensions
{
public static IRequestExecutorBuilder AddFeeDepositReportTypes(this IRequestExecutorBuilder builder)
{
builder.AddDataLoader<FeeDepositReport.PatientBatchDataLoader>();
builder.AddDataLoader<FeeDepositReport.PracticeLocationBatchDataLoader>();
builder.AddType<FeeDepositReport.StatementTransaction>();
builder.AddTypeExtension<FeeDepositReport.FeeDepositReportQuery>();
return builder;
}
}
Exception:
1. There is no object type implementing interface `StatementTransaction`. (HotChocolate.Types.InterfaceType<FeeDepositReport.StatementTransaction>)
Expected Result
public static class FeeDepositReportTypesRequestExecutorBuilderExtensions
{
public static IRequestExecutorBuilder AddFeeDepositReportTypes(this IRequestExecutorBuilder builder)
{
builder.AddDataLoader<FeeDepositReport.PatientBatchDataLoader>();
builder.AddDataLoader<FeeDepositReport.PracticeLocationBatchDataLoader>();
builder.AddType<FeeDepositReport.DepositStatementTransaction>();
builder.AddType<FeeDepositReport.BillingStatementTransaction>();
builder.AddTypeExtension<FeeDepositReport.FeeDepositReportQuery>();
return builder;
}
}
Relevant log output
1. There is no object type implementing interface `StatementTransaction`. (HotChocolate.Types.InterfaceType<FeeDepositReport.StatementTransaction>)
Additional Context?
No response
Version
12.21.0
Metadata
Metadata
Assignees
Labels
Area: AOT🌶️ hot chocolate🔍 investigateIndicates that an issue or pull request needs more information.
Activity
Fix #6513 register interface-derived object types
Fix #6513 register interface inheritance implementations (#9268)