Skip to content

Commit e3a8a02

Browse files
authored
Merge pull request #143 from ESchouten/input-type
Use correct KType when custom InputValue is provided
2 parents 05a6ac1 + 4fa90a5 commit e3a8a02

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/structure/SchemaCompilation.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ class SchemaCompilation(
332332
}
333333

334334
return operation.argumentsDescriptor.map { (name, kType) ->
335-
val kqlInput = inputValues.find { it.name == name } ?: InputValueDef(kType.jvmErasure, name)
336-
val inputType = handlePossiblyWrappedType(kType, TypeCategory.INPUT)
335+
val inputValue = inputValues.find { it.name == name }
336+
val kqlInput = inputValue ?: InputValueDef(kType.jvmErasure, name)
337+
val inputType = handlePossiblyWrappedType(inputValue?.kClass?.starProjectedType ?: kType, TypeCategory.INPUT)
337338
InputValue(kqlInput, inputType)
338339
}
339340
}

0 commit comments

Comments
 (0)