https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
r

Robert

04/29/2020, 7:17 AM
com.expediagroup.graphql.exceptions.TypeNotSupportedException: Cannot convert java.time.LocalDateTime? since it is not a valid GraphQL type or outside the supported packages is there an easy fix for this?
d

Dariusz Kuc

04/29/2020, 2:07 PM
you could expose it through the hook and configure jackson to correctly serialize/deserialize it
what we did instead is to represent date time objects explicitly to avoid any ambiguity
e.g. if local date time is serialized to a string what is the correct format? obviously you could add a comment saying what is expected format and then some validation around it but that would still result in error at runtime
if you expose those objects explicitly then you avoid any ambiguity, e.g.
Copy code
type DateTime {
  year: Int,
  month: Int, // or enum
  day: Int,
  hour: Int,
  minute: Int,
  second: Int,
  timeZone: ENUM
}
r

Robert

04/30/2020, 6:50 AM
I added this https://github.com/donbeave/graphql-java-datetime and went for string serialization
d

Dariusz Kuc

04/30/2020, 2:17 PM
👍
4 Views