My GraphQL server has a scalar type which converts...
# apollo-kotlin
r
My GraphQL server has a scalar type which converts to a list (ugh!). If I try to create a custom type mapping to
"kotlin.List<kotlin.String>"
I get an invalid character on
<
. Is there a way to have my custom type mapping be a list? If not, I'll create a wrapper type.
m
Apollo Kotlin doesn't support generic types for custom scalars but you can use a wrapper type
I'm hoping to revamp the custom scalar mapping with 4.0
r
Amazing, thanks
m
Sure thing!
It's still a very rough idea but I'd love to have something like this:
Copy code
@GraphQLAdapter(for = "Long")
class LongAdapter: Adapter<Long> {
  override fun fromJson(...): Long {
    //..
  }

  override fun toJson(...) {
    // ...
  }
}
This way all the custom scalar would be known at compile time