Skip to content

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Oct 7, 2025

Resolves #4488

This is kind of ... hard to assess where to best put this. I've put it in the scalar serialize as it felt the most appropriate, we could also put it in completeValue and return null regardless of whether this is an int/float scalar. We should however not throw errors so instead we'd return NaN from the scalars then instead of null and catch that in completeValue.

I found it a bit awkward to disregard the value completely for other types so I opted to put it in the scalars for that reason, i.e. there could be legitimate use cases for test-results or others where N/A is different from null.

We are sacrificing some form of accuracy here as a non-nullable field will return "cannot return null for x" when NaN is supplied while we do become more accurate by returning null for a nullable field rather than an error.

@JoviDeCroock JoviDeCroock requested a review from a team as a code owner October 7, 2025 17:09
@JoviDeCroock JoviDeCroock added the PR: bug fix 🐞 requires increase of "patch" version number label Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bug fix 🐞 requires increase of "patch" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of NaN on Int scalar violates GraphQL Specification
1 participant