Can't map GraphQL type: Currency to: Object.java
我已经创建了一个自定义类型适配器,但是我不完全知道如何映射标量Currency
,而我目前得到的响应是creditBalance=com.apollographql.apollo.response.CustomTypeValue$GraphQLString@a9b3abb
这是我的适配器:
object customTypeAdapteCurrency : CustomTypeAdapter<String> {
override fun encode(value: String): CustomTypeValue<*> {
return CustomTypeValue.GraphQLString(value)
}
override fun decode(value: CustomTypeValue<*>): String? {
return try {
java.lang.String.valueOf(value)
} catch (e: ParseException) {
return null
}
}
}