Skip to content

Coerce input values in a single pass - #5730

Draft
rmosolgo wants to merge 9 commits into
masterfrom
single-pass-input-values
Draft

rmosolgo wants to merge 9 commits into
masterfrom
single-pass-input-values

Conversation

@rmosolgo

@rmosolgo rmosolgo commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

For a long time, GraphQL-Ruby has validated before coercing -- but also implemented validation by coercing and checking for errors, discarding the coerced result.

It's time to fix this using the new input_values construct from Execution::Next. (Legacy execution will still coerce twice.)

Fixes #5535

TODO
  • What about this JSON-with-nested variables test? It failed because the variable isn't defined. It used to also fail because of the value. Should I retain compatibility with previous?
  • AstCoercionFailed is just a hack for now. Maybe I should move the error message up to coerce methods and remove the default overwrite in the validator and always used the message from the raised error
  • Add a test that makes sure that coerce isn't called twice

This branch has not been deployed

No deployments
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.

Single-pass input coercion + validation

1 participant