Skip to content

Nullable types for input need a default argument even if it's null #1525

Discussion options

You must be logged in to vote

Hello, in v6 we dropped the jackson support to deserialize arguments into kotlin types using reflections which requires all types to be provided in the constructor invocation.

As highlighted in our docs
https://opensource.expediagroup.com/graphql-kotlin/docs/schema-generator/writing-schemas/arguments/#default-values

The default value information is not available, given that the info is not part of the constructor, instead kotlin adds an indirection on top of it and there is no way to access to it through reflections

a good example of why we can't just assign null is a non nullable default value

data class Foo(
  val foo: String? = "foo"
)

through reflection we cannot determine whether foo…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@samuelAndalon
Comment options

@xenomachina
Comment options

@samuelAndalon
Comment options

@dariuszkuc
Comment options

@samuelAndalon
Comment options

Answer selected by dariuszkuc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants