railt/graphql

View on GitHub
resources/grammar/expression/variable.pp2

Summary

Maintainability
Test Coverage

/**
 * --------------------------------------------------------------------------
 *  GraphQL Variables
 * --------------------------------------------------------------------------
 *
 * A GraphQL query can be parameterized with variables, maximizing query
 * reuse, and avoiding costly string building in clients at runtime.
 *
 * If not defined as constant (for example, in DefaultValue), a Variable
 * can be supplied for an input value.
 *
 * Variables must be defined at the top of an operation and are in scope
 * throughout the execution of that operation.
 *
 * @see https://facebook.github.io/graphql/June2018/#sec-Language.Variables
 *
 */

Variable -> {
    return new Expr\VariableNode($children[0]->getValue());
}
  : <T_VARIABLE>
  ;