Skip to content

fix(coerceInputLiteral): null variable input object fields should override defaults#4711

Merged
yaacovCR merged 1 commit intographql:17.x.xfrom
yaacovCR:fix-explicit-null
May 4, 2026
Merged

fix(coerceInputLiteral): null variable input object fields should override defaults#4711
yaacovCR merged 1 commit intographql:17.x.xfrom
yaacovCR:fix-explicit-null

Conversation

@yaacovCR
Copy link
Copy Markdown
Contributor

@yaacovCR yaacovCR commented May 4, 2026

PR #3092 added coerceInputLiteral() and was authored by @leebyron. That version preserved explicit null variable values in input object fields by checking whether a variable was missing, not whether its value was nullish.

PR #3809 was the rebase of that work by @yaacovCR on top of the fragment variable work. In adapting the lookup to account for fragment variables, the missing-variable check was incorrectly replaced with a nullish value check, causing explicit null variables to be treated as omitted fields.

Only missing or explicitly undefined variables should omit/default input object fields. Explicit null variable values must be preserved for nullable fields.

…ride default

PR graphql#3092 added coerceInputLiteral() and was authored by @leebyron. That version preserved explicit null variable values in input object fields by checking whether a variable was missing, not whether its value was nullish.

PR graphql#3809 was the rebase of that work by @yaacovCR on top of the fragment variable work. In adapting the lookup to account for fragment variables, the missing-variable check was incorrectly replaced with a nullish value check, causing explicit null variables to be treated as omitted fields.

Only missing or explicitly undefined variables should omit/default input object fields. Explicit null variable values must be preserved for nullable fields.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

@yaacovCR is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@yaacovCR yaacovCR added the PR: bug fix 🐞 requires increase of "patch" version number label May 4, 2026
@yaacovCR yaacovCR merged commit 54f118c into graphql:17.x.x May 4, 2026
22 of 23 checks passed
@yaacovCR yaacovCR deleted the fix-explicit-null branch May 4, 2026 14:12
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.

1 participant