{"record":{"id":"f5415a54f9261621","repo":"hasura/graphql-engine","slug":"the-following-argument-in-command-command-name","errorCode":null,"errorMessage":"the following argument in command {command_name:} is defined more than once: {argument_name:}","messagePattern":"the following argument in command (.+?) is defined more than once: (.+?)","errorType":"validation","errorClass":"CommandsError::DuplicateCommandArgumentDefinition","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/commands/error.rs","lineNumber":72,"sourceCode":"\n            _other => None,\n        }\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum CommandsError {\n    #[error(\"the following command is defined more than once: {name:}\")]\n    DuplicateCommandDefinition { name: Qualified<CommandName> },\n    #[error(\n        \"the argument '{argument_name}' in command '{command_name}' has an unknown type: {argument_type}\"\n    )]\n    UnknownCommandArgumentType {\n        command_name: Qualified<CommandName>,\n        argument_name: Spanned<ArgumentName>,\n        argument_type: TypeReference,\n    },\n    #[error(\n        \"the following argument in command {command_name:} is defined more than once: {argument_name:}\"\n    )]\n    DuplicateCommandArgumentDefinition {\n        command_name: Qualified<CommandName>,\n        argument_name: Spanned<ArgumentName>,\n    },\n    #[error(\"source for the following command is defined more than once: {command_name:}\")]\n    DuplicateCommandSourceDefinition {\n        command_name: Qualified<CommandName>,\n    },\n    #[error(\n        \"the source data connector {data_connector:} for command {command_name:} has not been defined\"\n    )]\n    UnknownCommandDataConnector {\n        command_name: Qualified<CommandName>,\n        data_connector: Qualified<DataConnectorName>,\n    },\n    #[error(","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/commands/error.rs#L54-L90","documentation":"DuplicateCommandArgumentDefinition is raised when a single command declares the same argument name twice. Argument names must be unique within a command because they map to named GraphQL/input fields.","triggerScenarios":"Listing an argument name twice in one command's arguments mapping — often via YAML anchors, defaults merging, or copy-paste within the same command's arguments block.","commonSituations":"Copy-pasting argument blocks and forgetting to rename; YAML merge keys (<<:) accidentally including a key already defined explicitly; programmatic metadata generation emitting an argument twice.","solutions":["Find the duplicated argument_name in the command's arguments and remove/rename one occurrence","If generating metadata programmatically, de-duplicate by argument name before writing","Check YAML merge keys/anchors are not reintroducing an argument that is also defined inline"],"exampleFix":"# before\narguments:\n  limit:\n    type: Int\n  limit:            # duplicate\n    type: Int\n\n# after\narguments:\n  limit:\n    type: Int\n  offset:\n    type: Int","handlingStrategy":"validation","validationCode":"fn assert_unique_arguments(cmd: &Command) -> Result<(), String> {\n    let mut seen = HashSet::new();\n    for name in cmd.arguments.keys() {\n        if !seen.insert(name.clone()) {\n            return Err(format!(\"command {} has duplicate argument {name}\", cmd.name));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"Match DuplicateCommandArgumentDefinition and report command_name + argument_name (the Spanned argument carries source position for precise highlighting).","preventionTips":["Use maps/objects keyed by argument name in programmatic metadata so duplicates are impossible","Review YAML merge keys (<<:) that can silently duplicate arguments","Run a metadata linter for duplicate keys in CI"],"tags":["hasura","commands","duplicate","arguments","metadata"],"backgroundTag":"duplicate-definition","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}