hi all! does `graphql-kotlin-server` support scala...
# graphql-kotlin
v
hi all! does
graphql-kotlin-server
support scalar definitions for kotlin
value classes
?
d
πŸ‘‹ they are in the 6.x (still alpha) but its not yet documented TLDR you would need to do something similar as we did for handling the
ID
(https://opensource.expediagroup.com/graphql-kotlin/docs/schema-generator/writing-schemas/scalars#primitive-types)
πŸ‘ 1
v
thank you πŸ™ trying it out now
sorry, could it be that I'm missing something when I try to set this up? my schema doesn't seem to pick up the unboxing the value class:
Copy code
@JvmInline
value class BookId(
    val v: String
)
the value unboxer definition:
Copy code
open class BookIdValueUnboxer : ValueUnboxer {
    override fun unbox(`object`: Any?): Any? = if (`object` is BookId) {
         // log.debug { "Unboxing value: $`object`" }
        `object`.v
    } else {
        `object`
    }
}
and the registration to the GraphQL instance:
Copy code
GraphQL
     .newGraphQL(schema)
     .valueUnboxer(BookIdValueUnboxer())
     .build()
d
I'll take a look tomorrow
πŸ™ 1
hi πŸ‘‹ sorry for the delay, it looks like inline value class may require some additional changes to make it work
v
hi, thank you for checking it out πŸ™Œ
v
awesome, thank you very much πŸ™ everything works πŸŽ‰
πŸ‘ 1