{"record":{"id":"d90671f32f75d4e3","repo":"hasura/graphql-engine","slug":"function-function-name-is-not-defined-in-data-co","errorCode":null,"errorMessage":"function {function_name} is not defined in data connector {db_name}","messagePattern":"function (.+?) is not defined in data connector (.+?)","errorType":"validation","errorClass":"NDCValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/ndc_validation.rs","lineNumber":59,"sourceCode":"        argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"column {column_name} is not defined in collection {collection_name} in data connector {db_name}\"\n    )]\n    NoSuchColumn {\n        db_name: Qualified<DataConnectorName>,\n        model_name: Qualified<ModelName>,\n        field_name: FieldName,\n        collection_name: CollectionName,\n        column_name: DataConnectorColumnName,\n    },\n    #[error(\"procedure {procedure_name} is not defined in data connector {db_name}\")]\n    NoSuchProcedure {\n        db_name: Qualified<DataConnectorName>,\n        command_name: Qualified<CommandName>,\n        procedure_name: ProcedureName,\n    },\n    #[error(\"function {function_name} is not defined in data connector {db_name}\")]\n    NoSuchFunction {\n        db_name: Qualified<DataConnectorName>,\n        command_name: Qualified<CommandName>,\n        function_name: FunctionName,\n    },\n    #[error(\n        \"column {column_name} is not defined in function/procedure {func_proc_name} in data connector {db_name}\"\n    )]\n    NoSuchColumnForCommand {\n        db_name: Qualified<DataConnectorName>,\n        command_name: Qualified<CommandName>,\n        field_name: FieldName,\n        func_proc_name: String,\n        column_name: DataConnectorColumnName,\n    },\n    #[error(\n        \"column {column_name} has type {column_type} in collection {collection_name} in data connector {db_name}, not type {field_type}\"\n    )]","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/ndc_validation.rs#L41-L77","documentation":"Thrown during metadata resolution when a Command is configured to call a function that the target data connector's schema does not expose. The resolver cross-checks every function referenced in command definitions against the NDC connector's capability/schema response.","triggerScenarios":"Defining a Command with a CommandFunction target where function_name does not exist in the data connector's reported functions; using a stale connector schema after the function was renamed/dropped in the underlying database.","commonSituations":"Function renamed or dropped in the database without updating the metadata; typo in function name in the YAML metadata; connector schema cache out of date; promoting metadata between environments with different DB schemas.","solutions":["Verify the function exists in the data connector (query the database or the connector's /schema endpoint) and correct the function name in the Command definition","Reload/refresh the data connector's schema cache if the function was recently created","Align the metadata's function name with the connector's actual exported function name"],"exampleFix":"# before\nkind: Command\nspec:\n  target:\n    function:\n      name: get_user_by_email  # does not exist in connector\n# after\nkind: Command\nspec:\n  target:\n    function:\n      name: getUserByEmail   # matches connector schema","handlingStrategy":"validation","validationCode":"// before resolving, check the function exists in the connector schema\nlet exists = connector_schema.functions.iter().any(|f| f.name == metadata_function_name);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep connector schema in sync with the database (refresh before resolving)","Lint metadata function names against the connector schema in CI"],"tags":["ndc","metadata","command","function","validation"],"backgroundTag":"ndc-function-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}