Hey everyone - I’m facing an issue with BigInt typ...
# apollo-kotlin
m
Hey everyone - I’m facing an issue with BigInt type in GQL schema, I am using version 3.8.2, The generated type is
Any
and I am unable to convert it into Long. Any idea how I can convert the value to Long? the actual object after parsing is of type java.lang.Integer.
s
Is BigInt a custom scalar of your schema?
m
Yes
b
You can probably simply map it to a Long with
mapScalarToKotlinLong("BigInt")
If the value can exceed the capacity of a Kotlin Long (64 bits signed) though, you may want to map it to a BigDecimal instead (in which case you can use extra adapters)
1
m
Got it! Thanks @bod
👍 1
b
woops sorry the link to extra adapters is for v4. On v3, it exists too, but consult this doc instead.
m
It worked. Thanks!
🎉 2