I would like codegen to use `value class`es for ce...
# apollo-kotlin
c
I would like codegen to use `value class`es for certain id’s and things. Do I go down the route of custom scalars and define an adapter? https://www.apollographql.com/docs/kotlin/essentials/custom-scalars/
b
if the things in question are indeed scalars in the schema, then that sounds right 👍
c
Thanks!
Is there any reason to prefer registering adapters at build time versus runtime, or vice versa? https://www.apollographql.com/docs/kotlin/essentials/custom-scalars/#register-adapters
b
You need to register them at build time for the generated code to use your types. You can at the same time specify how to convert from Json (adapters), or do that part at runtime. I think in most cases it will make sense to do both at build time. You may need to register the adapters at runtime if this needs to be dynamic (not actually sure of a use case).