Robert
03/20/2021, 10:13 AM@GraphQLDescription("performs some operation")
fun doSomething(
@GraphQLDescription("super important value")
value: Int?
): Boolean = true
this works ✅
query {
doSomething(value:null) {
..
}
}
this fails in 4.0.0-alpha.15 ❗ : no argument provided for a required parameter: parameter #1 query of fun SomeQuery.doSomething(<http://kotlin.Int?|kotlin.Int?>)
and works with 3.7.0
query {
doSomething {
..
}
}
it works again when using a default
@GraphQLDescription("performs some operation")
fun doSomething(
@GraphQLDescription("super important value")
value: Int? = null
): Boolean = true
Dariusz Kuc
03/20/2021, 1:44 PMDariusz Kuc
03/20/2021, 2:00 PMShane Myrick
03/20/2021, 7:00 PMShane Myrick
03/20/2021, 7:20 PMnull
to the function in that case, we will not be able to use Kotlin default valuesShane Myrick
03/20/2021, 7:22 PMShane Myrick
03/20/2021, 7:24 PMKParameter
has a default value, we can only support one use case or the other.
• Support Kotlin default values but require them for nullable input
• Do not support Kotlin default values and always pass null
for input if argument is missing in requestDariusz Kuc
03/20/2021, 9:28 PMDariusz Kuc
03/20/2021, 9:29 PMShane Myrick
03/20/2021, 10:31 PMRobert
03/22/2021, 6:59 AMDariusz Kuc
03/22/2021, 2:05 PM