LocalDate coercion issue
shamresh opened this issue · comments
Hi,
I am getting the following error:
{
"errors": {
"message": "Caught ExecutionException: Failed to coerce {manufacturer:Joe Bloggs,name:Front bumper,oem:true,addedDate:2001-09-01} as NewPart"
}
}
If I leave out addedDate then the mutation works as expected.
My code is as follows:
stringScalar<LocalDate> {
serialize = { date ->
logger.info("Serialization of date: $date")
date.toString() }
deserialize = { dateString ->
logger.info("Deserialization of custom scalar type: $dateString")
LocalDate.parse(dateString) }
description = "Date in format yyyy-mm-dd"
}
and
mutation("addPart") {
description = "Adds a new part in the parts inventory database"
resolver { newPart: NewPart ->
val (name, manufacturer, addedDate, oem) = newPart
val part = Part(name, manufacturer, LocalDate.now(), oem)
val repository by kodein.instance<PartsRepository>()
repository.addPart(part)
}
}
inputType<NewPart>(){
}
This library is amazingly written.
Hi, where can I find release 0.3.1?
Thanks for all the great work.