Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
agatan opened this issue Aug 6, 2024 · 0 comments
Labels
type: bug Something isn't working

Comments

@agatan
Copy link

agatan commented Aug 6, 2024

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.

operator fun GraphQLContext.plus(map: Map<*, Any?>): GraphQLContext =
putAll(map)

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:

  • Change the signature to prevent null values from being passed. For example, change plus(map: Map<, Any?>) to plus(map: Map<, Any>).
  • Update the implementation to exclude entries where the value is null.
@agatan agatan added the type: bug Something isn't working label Aug 6, 2024
samuelAndalon added a commit that referenced this issue Aug 7, 2024
### 📝 Description
#2024

Co-authored-by: Samuel Vazquez <[email protected]>
samuelAndalon added a commit that referenced this issue Aug 7, 2024
### 📝 Description
#2024

Co-authored-by: Samuel Vazquez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

1 participant