pub fn validate_variable_values(
operation_name: Option<&str>,
variable_defs: &[VariableDefinition],
values: Option<&Value>,
) -> Result<()>Expand description
Check each supplied variable against the type its operation declares, and refuse a non-null variable that carries no value at all (§ 6.1.2).
This is the half § 5.8.5 cannot reach. query($n: Int!) { products(limit: $n) } is a correct usage whatever {"n": "2"} does to it, and what it
did was return the whole table: the value failed as_u64() at the read site
and the LIMIT clause was never emitted. The same happened when $n was
declared Int! and simply not supplied.
A variable with a default and no supplied value is left alone: the
default is what applies, and it was written against the same declaration.
A nullable variable with no value is also left alone, deliberately — that
is what lets limit: $limit fall back to the query’s compiled default
instead of forcing LIMIT NULL.
§Errors
Returns FraiseQLError::Validation naming the variable and its declared
type. As above, the supplied value is described, never quoted.