{"record":{"id":"0dbb4d2d12eb7b01","repo":"hasura/graphql-engine","slug":"argument-argument-name-is-not-defined-for-functi","errorCode":null,"errorMessage":"argument {argument_name} is not defined for function/procedure {func_proc_name} in data connector {db_name}","messagePattern":"argument (.+?) is not defined for function/procedure (.+?) in data connector (.+?)","errorType":"validation","errorClass":"NDCValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/ndc_validation.rs","lineNumber":35,"sourceCode":"use crate::types::subgraph::{Qualified, QualifiedTypeName, QualifiedTypeReference};\n\n#[derive(Debug, thiserror::Error)]\npub enum NDCValidationError {\n    #[error(\"collection {collection_name} is not defined in data connector {db_name}\")]\n    NoSuchCollection {\n        db_name: Qualified<DataConnectorName>,\n        model_name: Qualified<ModelName>,\n        collection_name: CollectionName,\n    },\n    #[error(\n        \"argument {argument_name} is not defined for collection {collection_name} in data connector {db_name}\"\n    )]\n    NoSuchArgument {\n        db_name: Qualified<DataConnectorName>,\n        collection_name: CollectionName,\n        argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"argument {argument_name} is not defined for function/procedure {func_proc_name} in data connector {db_name}\"\n    )]\n    NoSuchArgumentForCommand {\n        db_name: Qualified<DataConnectorName>,\n        func_proc_name: String,\n        argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"column {column_name} is not defined in collection {collection_name} in data connector {db_name}\"\n    )]\n    NoSuchColumn {\n        db_name: Qualified<DataConnectorName>,\n        model_name: Qualified<ModelName>,\n        field_name: FieldName,\n        collection_name: CollectionName,\n        column_name: DataConnectorColumnName,\n    },\n    #[error(\"procedure {procedure_name} is not defined in data connector {db_name}\")]","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/ndc_validation.rs#L17-L53","documentation":"Variant of NoSuchArgument specific to commands: metadata for a function or procedure command references an NDC argument that the connector's schema does not define for that function/procedure. The error includes the data connector name, the function/procedure name, and the offending NDC argument name.","triggerScenarios":"A command (function/procedure) mapped to a data connector whose argument mapping references an argument name not present in the connector's function/procedure definition; the database function signature changed (parameter renamed/removed); typo in ndc_argument_name in metadata.","commonSituations":"Database migrations altering function/procedure signatures; connector upgrades renaming parameters; metadata written by hand or generated against an older schema.","solutions":["Check the function/procedure signature in the database and the connector's schema for the exact parameter names","Update the argument mapping's ndc_argument_name to the current parameter name","If the parameter was removed, delete the mapping or preset for it","Refresh the connector schema and re-validate metadata"],"exampleFix":"// before\n\"arguments\": { \"usr_id\": { \"ndc_argument_name\": \"usr_id\" } }\n// after\n\"arguments\": { \"user_id\": { \"ndc_argument_name\": \"user_id\" } }","handlingStrategy":"validation","validationCode":"let fp = schema.functions.iter().chain(schema.procedures.iter())\n    .find(|f| f.name == func_proc_name)\n    .ok_or_else(|| format!(\"{func_proc_name} not in connector schema\"))?;\nfor name in referenced_args {\n    assert!(fp.arguments.contains_key(name), \"argument {name} not on {func_proc_name}\");\n}","typeGuard":"fn command_argument_defined(name: &str, fp: &NdcFunctionOrProcedure) -> bool {\n    fp.arguments.contains_key(name)\n}","tryCatchPattern":"Catch NoSuchArgumentForCommand and show the function/procedure's real parameter list to guide the fix.","preventionTips":["Keep DB function signatures and metadata in sync via migrations","Regenerate command metadata after signature changes","Validate command mappings against live connector schema in CI"],"tags":["ndc","commands","argument-mapping","data-connectors"],"backgroundTag":"unknown-argument-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}