Skip to main content

replaceVariables

Callable

  • replaceVariables(valueNode: ValueNode, variableValues?: Maybe<VariableValues>, fragmentVariableValues?: Maybe<VariableValues>): ConstValueNode

  • Replaces any Variables found within an AST Value literal with literals supplied from a map of variable values, or removed if no variable replacement exists, returning a constant value.

    Used primarily to ensure only complete constant values are used during input coercion of custom scalars which accept complex literals.


    Parameters

    • valueNode: ValueNode
    • optionalvariableValues: Maybe<VariableValues>
    • optionalfragmentVariableValues: Maybe<VariableValues>

    Returns ConstValueNode