Skip to content

Fix required: :nullable crash when combined with as:#5636

Merged
rmosolgo merged 1 commit into
rmosolgo:masterfrom
medlefsen:fix-required-nullable-with-as
May 19, 2026
Merged

Fix required: :nullable crash when combined with as:#5636
rmosolgo merged 1 commit into
rmosolgo:masterfrom
medlefsen:fix-required-nullable-with-as

Conversation

@medlefsen
Copy link
Copy Markdown
Contributor

I ran across this issue when trying to use as: on an argument which used required: :nullable. In my version it crashes with NoMethodError but it looks like in newer versions the validation just always fails.

This fix uses @keyword instead of arg_name, which I think should be correct. Tests pass.

The auto-registered RequiredValidator was keyed by the original
positional argument name, but `coerce_into_values` keys the values
hash by `@keyword` (which respects `as:`). When the two differed,
validation always failed; on older builds without safe-nav in
`arg_keyword_to_graphql_name` it crashed with NoMethodError.
@rmosolgo rmosolgo added this to the 2.6.3 milestone May 19, 2026
@rmosolgo
Copy link
Copy Markdown
Owner

Sorry for the trouble on this and thanks for contributing a fix!

@rmosolgo rmosolgo merged commit 57647a6 into rmosolgo:master May 19, 2026
12 of 13 checks passed
@medlefsen
Copy link
Copy Markdown
Contributor Author

Sorry for the trouble on this and thanks for contributing a fix!

No problem! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants