-
Notifications
You must be signed in to change notification settings - Fork 367
Open
Labels
module: generatorIssue affects the schema generator and federation codeIssue affects the schema generator and federation codetype: enhancementNew feature or requestNew feature or request
Description
The GraphQL spec allows for arguments to have default values:
Kotlin allows specifying default values:
This information is not available on reflection though due to the way Kotlin compiles to the JVM:
- https://discuss.kotlinlang.org/t/kotlin-reflection-and-default-values/2254
- https://discuss.kotlinlang.org/t/retrieve-default-parameter-value-via-reflection/7314
We could solve this issue by adding a new annotation @GraphQLDefaultValue
. This would require developers to duplicate some information but I think it would be worth it until we have a better way of extracting the info
fun getWidget(id: Int, @GraphQLDefaultValue(WidgetType.UNICORN) type: WidgetType = WidgetType.UNICORN) {
return database.getWidgetByIdAndType(id, type)
}
bakert, Bizilizi, rowi1de, saibotma, martinbonnin and 2 more
Metadata
Metadata
Assignees
Labels
module: generatorIssue affects the schema generator and federation codeIssue affects the schema generator and federation codetype: enhancementNew feature or requestNew feature or request