Netflix / dgs-codegen

Apache License 2.0
181 stars 98 forks source link

Add Currency default value handling #734

Open nithy1603 opened 3 weeks ago

nithy1603 commented 3 weeks ago

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

java.util.Currency

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

srinivasankavitha commented 3 weeks ago

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