Marcus Dunn
03/29/2021, 6:15 PMclass java.util.LinkedHashMap cannot be cast to class com.expediagroup.graphql.examples.server.spring.query.ScalarQuery$PhoneNumber
fun convolutedExample(optListInput: OptionalInput<List<PhoneNumber>>): String {
return patient
.let { if (it is OptionalInput.Defined) it.value else null }
?.map { it.number }
.toString()
}
data class PhoneNumber(val number: Long)
when called like this
@Test
fun test() {
val query = "convolutedExample"
val expectedData = "[111111]"
<http://testClient.post|testClient.post>()
.uri(GRAPHQL_ENDPOINT)
.accept(APPLICATION_JSON)
.contentType(GRAPHQL_MEDIA_TYPE)
.bodyValue("""query { $query(optListInput: [{
| number: 111111,
| }]
|) }""".trimMargin())
.exchange()
.verifyData(query, expectedData)
}
Have I gone wrong somewhere or is this just too many generics deep for jackson to figure out?Dariusz Kuc
03/29/2021, 6:22 PMOptionalInput
wrapperMarcus Dunn
03/29/2021, 6:30 PMDariusz Kuc
03/29/2021, 6:31 PMMarcus Dunn
03/29/2021, 7:26 PM