Skip to content

How do I rename/hook fields out of my control? #882

Discussion options

You must be logged in to vote

graphql-kotlin was written to work natively with Kotlin due to (among other things) the strong type safety guaranteed by the language. Any reference in Java may be null so it basically breaks any guarantees from Kotlin (see: official documentation). I'd advise against using Java POJOs as you will be missing null safety information. Instead why not recreate those objects as Kotlin data classes where you can specify proper nullability (and names)?

// i'd assume some of those fields should be non-null
data class Ohlc(val close: Point?, val high: BigDecimal?, val low: BigDecimal?, val open: Point?, val symbol: String?, val volume: BigDecimal?)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dariuszkuc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #882 on October 01, 2020 21:10.