dgs-codegen icon indicating copy to clipboard operation
dgs-codegen copied to clipboard

Generated code for nested input types with default values fails

Open deweyjose opened this issue 2 years ago • 3 comments

This issue was originally found in the maven plugin implementation of codegen.

input SomeKindOfInput {
  nestedInput: NestedInput = {enumField : ENUM_VALUE1}
}

input NestedInput {
  enumField: SomeKindOfEnum!
}

Generates an invalid Java file:

public class SomeKindOfInput {
  private NestedInput nestedInput = ObjectValue{objectFields=[ObjectField{name='enumField', value=EnumValue{name='ENUM_VALUE1'}}]};
} 

deweyjose avatar Jan 02 '24 03:01 deweyjose

Thanks for reporting @deweyjose. We will look into a fix in the coming weeks. In the meantime, if you are blocked, please feel free to open a PR.

srinivasankavitha avatar Jan 05 '24 19:01 srinivasankavitha

Hi @srinivasankavitha,

Not blocked currently, thanks for taking a look!

deweyjose avatar Jan 10 '24 01:01 deweyjose