Skip to main content

validate_argument_values

Function validate_argument_values 

Source
pub fn validate_argument_values(
    field_label: &str,
    declared: &[ArgumentDefinition],
    provided: &[GraphQLArgument],
    variable_defs: &[VariableDefinition],
) -> Result<()>
Expand description

Check the value written at each of provided against the type declared gives that argument (§ 5.6.1), and the declared type of each variable used there against the same (§ 5.8.5).

field_label names the field the way a client reads a schema — Query.orders — and declared is the field’s published argument list (QueryDefinition::graphql_arguments), which is where the auto-wired limit: Int and offset: Int acquire a type. An argument with no entry there is not adjudicated: the relay cursor window and nearest are read by their own runners and are accepted by name alone.

§Errors

Returns FraiseQLError::Validation naming the field, the argument, the type it declares and the type the document wrote. The offending value is not quoted back — the shape is what the client needs, and a value in an error message is how #1197’s second half returned a stored row to its caller.