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

Input Value Validation #3813

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Commits on Oct 18, 2024

  1. Input Value Validation

    Factors out input validation to reusable functions:
    
    * Introduces `validateInputLiteral` by extracting this behavior from `ValuesOfCorrectTypeRule`.
    * Introduces `validateInputValue` by extracting this behavior from `coerceInputValue`
    * Simplifies `coerceInputValue` to return early on validation error
    * Unifies error reporting between `validateInputValue` and `validateInputLiteral`, causing some error message strings to change, but error data (eg locations) are preserved.
    
    These two parallel functions will be used to validate default values in graphql#3049
    
    Potentially breaking if you rely on the existing behavior of `coerceInputValue` to call a callback function, as the call signature has changed, or to throw with the default callback function. Grossly similar behavior is available with `validateInputValue()`, but with a separate function. GraphQL behavior should not change, though error messages are now slightly different.
    leebyron authored and yaacovCR committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    7ee722c View commit details
    Browse the repository at this point in the history