ExpediaGroup / graphql-kotlin

Libraries for running GraphQL in Kotlin
https://opensource.expediagroup.com/graphql-kotlin/
Apache License 2.0
1.74k stars 351 forks source link

GraphQLContext.plus(map: Map<*, Any?>) throws graphql.AssertException for null values #2024

Open agatan opened 3 months ago

agatan commented 3 months ago

Library Version 7.1.4

Describe the bug GraphQLContext.plus(map: Map<*, Any?>) has a signature that suggests it can accept null values, but passing null actually throws an AssertException.

https://github.com/ExpediaGroup/graphql-kotlin/blob/d038e2e4aa8229e53e24c9046aa16c0c1a2378a6/generator/graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/extensions/GraphQLContextExtensions.kt#L65-L66

To Reproduce

GraphQLContext.newContext().build().plus(mapOf("X" to null))

will throw graphql.AssertException: Object required to be not null.

Expected behavior

One of the following should be addressed: