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

Add valueToLiteral() #3812

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Commits on Sep 29, 2024

  1. Add valueToLiteral()

    * Adds `valueToLiteral()` which takes an external value and translates it to a literal, allowing for custom scalars to define this behavior.
    
    This also adds important changes to Input Coercion, especially for custom scalars:
    
    * Addition of `parseConstLiteral()` to leaf types which operates in parallel to `parseLiteral()` but take `ConstValueNode` instead of `ValueNode` -- the second `variables` argument has been removed. For all built-in scalars this has no effect, but any custom scalars which use complex literals no longer need to do variable reconciliation manually (in fact most do not -- this has been an easy subtle bug to miss).
    
      This behavior is possible with the addition of `replaceVariables()`.
      `parseLiteral()` is no longer used internally and has been marked for deprecation.
    leebyron authored and yaacovCR committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    bc6af39 View commit details
    Browse the repository at this point in the history