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

Add Currency default value handling

Open nithy1603 opened this issue 1 year ago • 1 comments

Please add feature to handle default values for Currency in GraphQL Schema.

Description:

We have defined a custom scalar for currency extending graphql-java-extended-scalars Currency scalar. A typemapping for the custom scalar is provided for the graphqlcodegen-maven-plugin as follows

<CustomCurrency>java.util.Currency</CustomCurrency>

An input type MoneyInput is defined in the graphql schema with a default value for currency input MoneyInput {

currency: CustomCurrency! = "USD"

value: Decimal!

}

The compilation give the following error: incompatible types: java.lang.String cannot be converted to java.util.Currency

nithy1603 avatar Aug 19 '24 18:08 nithy1603

Thanks for creating this issue. Will fix in the next release.

srinivasankavitha avatar Aug 19 '24 21:08 srinivasankavitha

Released in DGS Codegen v8.0.0.

iuliiasobolevska avatar Apr 08 '25 19:04 iuliiasobolevska