Skip to content

Union array type in interfaces generated wrong #1018

@hlege

Description

@hlege

Issue Description

Union array types in interfaces now generate the exact type e.g.: List<UnionType>, but it should be List<? extends UnionType>

Steps to Reproduce

union FooOrBar = Foo | Bar

type Foo {
  id: ID!
}

type Bar {
  id: ID!
}

interface ResultObject {
  list: [FooOrBar!]
}

type MyFooResult implements ResultObject {
  list: [Foo!]
}

type MyBarResult implements ResultObject {
  list: [Bar!]
}

Expected Result

The code should compile.

public interface ResultObject {

    java.util.List<? extends FooOrBar> getList();

}

Actual Result

public interface ResultObject {

    java.util.List<FooOrBar> getList();

}

io.github.kobylynskyi.bikeshop.graphql.model.MyFooResult is not abstract and does not override abstract method getList() in io.github.kobylynskyi.bikeshop.graphql.model.ResultObject

Your Environment and Setup

  • graphql-java-codegen version: 5.5.0
  • Build tool: E.g.: Maven

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions