Netflix / dgs-codegen

Apache License 2.0
177 stars 92 forks source link

Generating extended types that implement interfaces in the extension fails to generated the actual interface implementation #696

Open THE-ORONCO opened 1 month ago

THE-ORONCO commented 1 month ago

Given a simple GraphQL schema where a type is extended in multiple places and interfaces are implemented in those extensions, DGS codegen fails to generate the implementation in the java classes.

A small example:

interface A { name : String }

type Example implements A {
    name: String
}

interface B { age :Int }

extend type Example implements B{
    age :Int
}

generates the following java class which does not implement the also generated B interface:

public class Example implements org.example.codegen.types.A {
  private String name;
  private Integer age;

  // ... the rest of the code
}

The expected behaviour would be that the java class implements both A and B. Especially because the fields added by the extension are actually generated.

kailyak commented 4 weeks ago

Hello, thank you for the report. I tested this out and was able to reproduce the reported behavior. This has been added to the backlog and will be prioritized in the coming weeks.