Skip to main content

validate_enum_argument_values

Function validate_enum_argument_values 

Source
pub fn validate_enum_argument_values(
    schema: &CompiledSchema,
    field_label: &str,
    declared: &[ArgumentDefinition],
    provided: Option<&Value>,
) -> Result<()>
Expand description

Adjudicate enum membership for the values written at a field’s arguments, from a resolved argument map (#1362).

This is the entry the mutation chokepoint uses, and the reason it takes a map rather than a document’s [GraphQLArgument]: execute_mutation_impl is where every transport that writes converges, and REST, gRPC and MCP arrive there with a JSON payload and no GraphQL document at all. Inline literals are already merged into that same map (#719), so one call covers a literal, a variable and a payload alike.

provided is the map arguments are read out of — the value under each argument’s own name. An argument with no entry is not adjudicated; whether it was required is the mutation runner’s question, asked a few lines later.

§Errors

Returns FraiseQLError::Validation naming the path to the offending field and the members its enum declares.