hasura/graphql-engine · error · CommandsIssue::InvalidCommandOutputType
Command '{command_name}' has an invalid output type '{output
Error message
Command '{command_name}' has an invalid output type '{output_type}' What it means
Indicates a command's declared output TypeReference is not a valid output type (must be an object type usable as a GraphQL output).
Source
Thrown at v3/crates/metadata-resolve/src/stages/commands/types.rs:93
command_name: Qualified<CommandName>,
function_name: FunctionName,
issue: ArgumentMappingIssue,
},
#[error(
"An issue occurred while mapping arguments in the command {command_name:} to the procedure {procedure_name:} in the data connector {data_connector_name:}: {issue:}"
)]
ProcedureArgumentMappingIssue {
data_connector_name: Qualified<DataConnectorName>,
command_name: Qualified<CommandName>,
procedure_name: ProcedureName,
issue: ArgumentMappingIssue,
},
#[error("Cannot add the command {command_name:} to GraphQL schema: {error:}")]
GraphQlRootFieldAlreadyInUse {
command_name: Qualified<CommandName>,
error: DuplicateRootFieldError,
},
#[error("Command '{command_name}' has an invalid output type '{output_type}'")]
InvalidCommandOutputType {
command_name: Qualified<CommandName>,
output_type: TypeReference,
},
}
impl ShouldBeAnError for CommandsIssue {
fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {
match self {
CommandsIssue::GraphQlRootFieldAlreadyInUse { .. } => {
flags.contains(open_dds::flags::Flag::RequireUniqueCommandGraphqlNames)
}
CommandsIssue::InvalidCommandOutputType { .. } => {
flags.contains(open_dds::flags::Flag::RequireValidCommandOutputType)
}
CommandsIssue::FunctionArgumentMappingIssue { issue, .. }
| CommandsIssue::ProcedureArgumentMappingIssue { issue, .. } => {
issue.should_be_an_error(flags)View on GitHub (pinned to 724551b9ae)
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
Defensive patterns
Strategy: validation
Validate before calling
// Verify the command's output type resolves to an object type assert!(matches!(lookup(&output_type), Some(t) if t.is_object()));
Try / catch
Catch InvalidCommandOutputType and report the command name and offending type.
Prevention
- Use generated metadata rather than hand-editing output types
- Remove commands when deleting their output types
When it happens
Trigger: Setting a command's output type to a scalar/enum-only type, an undefined type, or a type not permitted as command output.
Common situations: Hand-editing metadata to point a command at a scalar type, or deleting a type still referenced as a command output.
Related errors
- Cannot add the command {command_name:} to GraphQL schema: {e
- error in getting server feature flags %w
- parsing 'admin_secrets' from config.yaml / environment varia
- Field mapping not found for the field {field_name:} of type
- Object type '{type_name}' not found
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/95a50bfd5ba1cd9e.
Report an issue: GitHub.