Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Analyzers: Does not work using inheritance and Annotation-based #6513

Copy link
Copy link

Description

@jaredromano
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.