I'm working with GraphQL. The schema contains:
scalar DateTime
type Something {
timestamp: DateTime
}
When I build the app the ApolloClient plugin generates the class:
public class DateTime {
public companion object {
public val type: CustomScalarType = CustomScalarType("DateTime", "kotlin.Any")
}
}
Do I have to use this one when I build the ApolloClient? Like this?
val apolloClient = ApolloClient.builder()
.serverUrl("xxxx")
.okHttpClient(httpClient)
.addCustomTypeAdapter(DateTime.type, adapter)
.build()
I found here the list of the already available adapters but I can't find how to import them and anyway none of them seems appropriate.
Do I have to define my own custom adapter?
EDIT
To import them it is enough to import com.apollographql.apollo3:apollo-adapters.