{"record":{"id":"1c5959b9625e926c","repo":"hasura/graphql-engine","slug":"custom-result-type-of-function-function-or-proced","errorCode":null,"errorMessage":"Custom result type of function {function_or_procedure_name:} does not match custom output type of command: {command_name:}","messagePattern":"Custom result type of function (.+?) does not match custom output type of command: (.+?)","errorType":"validation","errorClass":"NDCValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/ndc_validation.rs","lineNumber":124,"sourceCode":"    },\n    #[error(\n        \"Field {field_name} for type {type_name} referenced in model {model_name} is not defined\"\n    )]\n    UnknownTypeField {\n        model_name: ModelName,\n        type_name: CustomTypeName,\n        field_name: FieldName,\n    },\n    #[error(\n        \"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:}\"\n    )]\n    FuncProcAndCommandScalarOutputTypeMismatch {\n        function_or_procedure_name: String,\n        function_or_procedure_output_type: String,\n        command_name: String,\n        command_output_type: String,\n    },\n    #[error(\n        \"Custom result type of function {function_or_procedure_name:} does not match custom output type of command: {command_name:}\"\n    )]\n    FuncProcAndCommandCustomOutputTypeMismatch {\n        function_or_procedure_name: String,\n        command_name: String,\n    },\n    #[error(\"data connector does not support queries\")]\n    QueryCapabilityUnsupported,\n    #[error(\"data connector does not support mutations\")]\n    MutationCapabilityUnsupported,\n\n    // for `DataConnectorLink.argumentPresets` not all type representations are supported.\n    #[error(\n        \"Unsupported type representation {representation:} in scalar type {scalar_type:}, for argument preset name {argument_name:}. Only 'json' representation is supported.\"\n    )]\n    UnsupportedTypeInDataConnectorLinkArgumentPreset {\n        representation: String,\n        scalar_type: DataConnectorScalarType,","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/ndc_validation.rs#L106-L142","documentation":"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.","triggerScenarios":"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.","commonSituations":"Refactoring a type into two variants and updating only one side; copy-pasting command definitions; qualified names differing by subgraph prefix.","solutions":["Make the command's output type the same custom type as the function's declared result type","Or update the function's response configuration to return the command's type","Check subgraph qualification of both type names so they compare equal"],"exampleFix":"# before\n# function result type: app.User; command output_type: app.UserDetails\n# after\nspec:\n  output_type: { object: app.User }","handlingStrategy":"validation","validationCode":"if both custom(function, command) {\n    assert_eq!(function.result_custom_type, command.output_custom_type);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a single source of truth for custom result type names between functions and commands"],"tags":["command","output-type","custom-type","ndc"],"backgroundTag":"command-output-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}