{"record":{"id":"480beec71da1b8d3","repo":"hasura/graphql-engine","slug":"the-argument-argument-name-in-command-comman","errorCode":null,"errorMessage":"the argument '{argument_name}' in command '{command_name}' has an unknown type: {argument_type}","messagePattern":"the argument '(.+?)' in command '(.+?)' has an unknown type: (.+?)","errorType":"validation","errorClass":"CommandsError::UnknownCommandArgumentType","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/commands/error.rs","lineNumber":64,"sourceCode":"                    path: argument_name\n                        .path\n                        .clone()\n                        .parent()\n                        .append_key(\"type\".into()),\n                    message: format!(\"The argument type '{argument_type}' has not been defined\",),\n                }),\n            ),\n\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    },","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/commands/error.rs#L46-L82","documentation":"UnknownCommandArgumentType is raised when a command argument references a type that cannot be resolved in the metadata's type system (not a known scalar, object, or predicate type). Argument types must resolve to TypeReference-known types; otherwise the command cannot be compiled.","triggerScenarios":"Declaring a command argument whose argument_type TypeReference names a type that is undefined (typo, missing object type declaration, or unreferenced scalar), then running the commands resolve stage.","commonSituations":"Typos in argument type names; removing/renaming an object type without updating commands that use it; forgetting to declare a custom scalar; version upgrades renaming built-in types (e.g. predicate input names changing).","solutions":["Check the argument_type in the error and fix the spelling/name to match a declared type","Declare the missing object type or custom scalar in metadata if the command argument needs it","If the type was renamed (upgrade/migration), update the command argument to the new name"],"exampleFix":"# before\narguments:\n  filter:\n    type: UserFilterTypo   # declared type is UserFilter\n\n# after\narguments:\n  filter:\n    type: UserFilter","handlingStrategy":"type-guard","validationCode":"// Verify every command argument type resolves before calling resolve\nfor cmd in &metadata.commands {\n    for (arg_name, arg) in &cmd.arguments {\n        if !known_types.contains(&arg.argument_type) {\n            return Err(format!(\"command {} argument {arg_name} has unknown type {}\", cmd.name, arg.argument_type));\n        }\n    }\n}","typeGuard":"fn argument_type_is_known(ty: &TypeReference, known: &HashSet<String>) -> bool {\n    match ty { TypeReference::Named(n) => known.contains(n), _ => true }\n}","tryCatchPattern":"Match UnknownCommandArgumentType { command_name, argument_name, argument_type } and suggest the closest known type name (fuzzy match) to speed up typo fixes.","preventionTips":["Declare object types and custom scalars before commands that use them","Use IDE/schema autocompletion or a metadata linter to catch typos in type names","After renames, grep all commands for the old type name"],"tags":["hasura","commands","unknown-type","metadata","typo"],"backgroundTag":"unknown-type-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}