{"record":{"id":"95a50bfd5ba1cd9e","repo":"hasura/graphql-engine","slug":"command-command-name-has-an-invalid-output-typ","errorCode":null,"errorMessage":"Command '{command_name}' has an invalid output type '{output_type}'","messagePattern":"Command '(.+?)' has an invalid output type '(.+?)'","errorType":"validation","errorClass":"CommandsIssue::InvalidCommandOutputType","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/commands/types.rs","lineNumber":93,"sourceCode":"        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:}\")]\n    GraphQlRootFieldAlreadyInUse {\n        command_name: Qualified<CommandName>,\n        error: DuplicateRootFieldError,\n    },\n    #[error(\"Command '{command_name}' has an invalid output type '{output_type}'\")]\n    InvalidCommandOutputType {\n        command_name: Qualified<CommandName>,\n        output_type: TypeReference,\n    },\n}\n\nimpl ShouldBeAnError for CommandsIssue {\n    fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {\n        match self {\n            CommandsIssue::GraphQlRootFieldAlreadyInUse { .. } => {\n                flags.contains(open_dds::flags::Flag::RequireUniqueCommandGraphqlNames)\n            }\n            CommandsIssue::InvalidCommandOutputType { .. } => {\n                flags.contains(open_dds::flags::Flag::RequireValidCommandOutputType)\n            }\n            CommandsIssue::FunctionArgumentMappingIssue { issue, .. }\n            | CommandsIssue::ProcedureArgumentMappingIssue { issue, .. } => {\n                issue.should_be_an_error(flags)","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/commands/types.rs#L75-L111","documentation":"Indicates a command's declared output TypeReference is not a valid output type (must be an object type usable as a GraphQL output).","triggerScenarios":"Setting a command's output type to a scalar/enum-only type, an undefined type, or a type not permitted as command output.","commonSituations":"Hand-editing metadata to point a command at a scalar type, or deleting a type still referenced as a command output.","solutions":["Change the command's output type to a valid object type defined in metadata","Verify the referenced type exists and is an object type","Rebuild"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the command's output type resolves to an object type\nassert!(matches!(lookup(&output_type), Some(t) if t.is_object()));","typeGuard":null,"tryCatchPattern":"Catch InvalidCommandOutputType and report the command name and offending type.","preventionTips":["Use generated metadata rather than hand-editing output types","Remove commands when deleting their output types"],"tags":["commands","output-type","graphql","metadata"],"backgroundTag":"invalid-type-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}