hasura/graphql-engine · error · NDCValidationError

Custom result type of function {function_or_procedure_name:}

Error message

Custom result type of function {function_or_procedure_name:} does not match custom output type of command: {command_name:}

What it means

Both the NDC function and the command declare custom (object) result types, but they are not the same custom type. The resolver requires the function's custom result type and the command's custom output type to be identical.

Source

Thrown at v3/crates/metadata-resolve/src/helpers/ndc_validation.rs:124

    },
    #[error(
        "Field {field_name} for type {type_name} referenced in model {model_name} is not defined"
    )]
    UnknownTypeField {
        model_name: ModelName,
        type_name: CustomTypeName,
        field_name: FieldName,
    },
    #[error(
        "Result type of function/procedure {function_or_procedure_name:} is {function_or_procedure_output_type:} but output type of command {command_name:} is {command_output_type:}"
    )]
    FuncProcAndCommandScalarOutputTypeMismatch {
        function_or_procedure_name: String,
        function_or_procedure_output_type: String,
        command_name: String,
        command_output_type: String,
    },
    #[error(
        "Custom result type of function {function_or_procedure_name:} does not match custom output type of command: {command_name:}"
    )]
    FuncProcAndCommandCustomOutputTypeMismatch {
        function_or_procedure_name: String,
        command_name: String,
    },
    #[error("data connector does not support queries")]
    QueryCapabilityUnsupported,
    #[error("data connector does not support mutations")]
    MutationCapabilityUnsupported,

    // for `DataConnectorLink.argumentPresets` not all type representations are supported.
    #[error(
        "Unsupported type representation {representation:} in scalar type {scalar_type:}, for argument preset name {argument_name:}. Only 'json' representation is supported."
    )]
    UnsupportedTypeInDataConnectorLinkArgumentPreset {
        representation: String,
        scalar_type: DataConnectorScalarType,

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Make the command's output type the same custom type as the function's declared result type
  2. Or update the function's response configuration to return the command's type
  3. Check subgraph qualification of both type names so they compare equal

Example fix

# before
# function result type: app.User; command output_type: app.UserDetails
# after
spec:
  output_type: { object: app.User }
Defensive patterns

Strategy: validation

Validate before calling

if both custom(function, command) {
    assert_eq!(function.result_custom_type, command.output_custom_type);
}

Prevention

When it happens

Trigger: Function's response config names one object type while the command's output_type names another (e.g. User vs UserDetails) even if structurally similar.

Common situations: Refactoring a type into two variants and updating only one side; copy-pasting command definitions; qualified names differing by subgraph prefix.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/1c5959b9625e926c. Report an issue: GitHub.