com.expediagroup.graphql.exceptions.TypeNotSupport...
# graphql-kotlin
r
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
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
I added this https://github.com/donbeave/graphql-java-datetime and went for string serialization
d
👍