-
Notifications
You must be signed in to change notification settings - Fork 367
Closed
Labels
module: generatorIssue affects the schema generator and federation codeIssue affects the schema generator and federation codetype: bugSomething isn't workingSomething isn't working
Description
Library Version
graphql-kotlin-spring-server version "6.1.0"
org.springframework.boot version "2.7.2"
Describe the bug
When using a default argument for a child object, the default parameter is given "null" instead of a default value.
To Reproduce
Steps to reproduce the behavior. Please provide:
For a depth of 1
@Component
class DefaultValueQueryDepth1 : Query {
suspend fun returnTrueIfModelValueDefaults(queryModel: QueryModel?): Boolean {
return queryModel?.value == "defaultValue"
}
}
data class QueryModel(val value: String? = "defaultValue")
For a depth of 2
@Component
class DefaultValueQueryDepth2 : Query {
suspend fun returnTrueIfChildValueDefaults(parentQueryModel: ParentQueryModel): Boolean {
return parentQueryModel.childQueryModel?.value == "defaultValue"
}
}
data class ParentQueryModel(val childQueryModel: ChildQueryModel? = ChildQueryModel("defaultValue"))
data class ChildQueryModel(val value: String? = "defaultValue")
Please also see the following repo for the bug : https://github.com/JustinSchwarzwald/GraphQLDefaultingValuesBug
Expected behavior
The child object should receive the default value that is specified.
Metadata
Metadata
Assignees
Labels
module: generatorIssue affects the schema generator and federation codeIssue affects the schema generator and federation codetype: bugSomething isn't workingSomething isn't working