{"record":{"id":"c0a747079aa7c61c","repo":"hasura/graphql-engine","slug":"an-issue-occurred-while-mapping-arguments-in-the-c","errorCode":null,"errorMessage":"An issue occurred while mapping arguments in the command {command_name:} to the function {function_name:} in the data connector {data_connector_name:}: {issue:}","messagePattern":"An issue occurred while mapping arguments in the command (.+?) to the function (.+?) in the data connector (.+?): (.+?)","errorType":"validation","errorClass":"CommandsIssue::FunctionArgumentMappingIssue","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/commands/types.rs","lineNumber":70,"sourceCode":"        BTreeMap<DataConnectorArgumentName, ArgumentPresetValue>,\n    pub source_arguments: BTreeMap<DataConnectorArgumentName, ndc_models::Type>,\n}\n\n#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]\npub struct Command {\n    pub name: Qualified<CommandName>,\n    pub output_type: QualifiedTypeReference,\n    pub arguments: IndexMap<ArgumentName, ArgumentInfo>,\n    pub graphql_api: Option<CommandGraphQlApi>,\n    pub source: Option<Arc<CommandSource>>,\n    #[serde(default = \"serde_ext::ser_default\")]\n    #[serde(skip_serializing_if = \"serde_ext::is_ser_default\")]\n    pub description: Option<String>,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum CommandsIssue {\n    #[error(\n        \"An issue occurred while mapping arguments in the command {command_name:} to the function {function_name:} in the data connector {data_connector_name:}: {issue:}\"\n    )]\n    FunctionArgumentMappingIssue {\n        data_connector_name: Qualified<DataConnectorName>,\n        command_name: Qualified<CommandName>,\n        function_name: FunctionName,\n        issue: ArgumentMappingIssue,\n    },\n    #[error(\n        \"An issue occurred while mapping arguments in the command {command_name:} to the procedure {procedure_name:} in the data connector {data_connector_name:}: {issue:}\"\n    )]\n    ProcedureArgumentMappingIssue {\n        data_connector_name: Qualified<DataConnectorName>,\n        command_name: Qualified<CommandName>,\n        procedure_name: ProcedureName,\n        issue: ArgumentMappingIssue,\n    },\n    #[error(\"Cannot add the command {command_name:} to GraphQL schema: {error:}\")]","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/commands/types.rs#L52-L88","documentation":"Thrown when mapping a Command's declared arguments onto a data connector Function's parameters fails. The ArgumentMappingIssue describes the specific mismatch (missing argument, wrong type, etc.) for the named command/function/connector triple.","triggerScenarios":"Declaring a Command with an argument name or type that doesn't match any parameter of the target function in the data connector's schema.","commonSituations":"Function signature changed in the connector; metadata still passes a removed/renamed argument or an incompatible type.","solutions":["Check the inner issue to see which argument failed","Align argument names/types in the command definition with the connector function's parameters","If the connector changed, regenerate metadata from the new schema"],"exampleFix":"// before\ncommand MyCommand {\n  function: my_function\n  arguments: { old_arg: \"...\" }\n}\n// after (renamed to match connector parameter)\ncommand MyCommand {\n  function: my_function\n  arguments: { new_arg: \"...\" }\n}","handlingStrategy":"validation","validationCode":"// Before resolving, cross-check command argument names against the connector schema's function parameters\nlet params: HashSet<_> = function.parameters.keys().cloned().collect();\nassert!(command.arguments.keys().all(|k| params.contains(k)), \"unmapped command argument\");","typeGuard":null,"tryCatchPattern":"Catch CommandsError, downcast to CommandsIssue::FunctionArgumentMappingIssue, report the offending argument.","preventionTips":["Generate command metadata from the connector's schema","Add CI checks that command arguments match function signatures"],"tags":["commands","argument-mapping","data-connector","metadata"],"backgroundTag":"argument-mapping-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}