{"record":{"id":"51a3fdf8b15b0afe","repo":"hasura/graphql-engine","slug":"argument-argument-name-is-not-defined-for-collec","errorCode":null,"errorMessage":"argument {argument_name} is not defined for collection {collection_name} in data connector {db_name}","messagePattern":"argument (.+?) is not defined for collection (.+?) in data connector (.+?)","errorType":"validation","errorClass":"NDCValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/ndc_validation.rs","lineNumber":27,"sourceCode":"    commands::{CommandName, DataConnectorCommand, FunctionName, ProcedureName},\n    data_connector::{\n        CollectionName, DataConnectorColumnName, DataConnectorName, DataConnectorScalarType,\n    },\n    models::ModelName,\n    types::{CustomTypeName, DataConnectorArgumentName, FieldName},\n};\n\nuse crate::types::subgraph::{Qualified, QualifiedTypeName, QualifiedTypeReference};\n\n#[derive(Debug, thiserror::Error)]\npub enum NDCValidationError {\n    #[error(\"collection {collection_name} is not defined in data connector {db_name}\")]\n    NoSuchCollection {\n        db_name: Qualified<DataConnectorName>,\n        model_name: Qualified<ModelName>,\n        collection_name: CollectionName,\n    },\n    #[error(\n        \"argument {argument_name} is not defined for collection {collection_name} in data connector {db_name}\"\n    )]\n    NoSuchArgument {\n        db_name: Qualified<DataConnectorName>,\n        collection_name: CollectionName,\n        argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"argument {argument_name} is not defined for function/procedure {func_proc_name} in data connector {db_name}\"\n    )]\n    NoSuchArgumentForCommand {\n        db_name: Qualified<DataConnectorName>,\n        func_proc_name: String,\n        argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"column {column_name} is not defined in collection {collection_name} in data connector {db_name}\"\n    )]","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/ndc_validation.rs#L9-L45","documentation":"NDCValidationError::NoSuchArgument indicates that metadata (typically a model's collection arguments or an argument mapping) references a data connector argument name that is not declared for the collection in the connector's schema. The resolver validates each NDC-side argument reference against the collection's argument list in the schema response.","triggerScenarios":"A model mapping or preset referencing an NDC collection argument that was removed or renamed in the connector schema; adding an argument mapping with a typo'd NDC argument name; connector version change altering collection arguments.","commonSituations":"Connector schema drift after upgrade; hand-editing argument mappings; copying mappings between connectors whose argument names differ.","solutions":["Fetch the connector's schema and list the collection's declared arguments","Correct the NDC argument name in the mapping/preset to match exactly","If the argument should exist, fix the collection definition on the connector side and refresh the schema","Remove stale mappings/presets for arguments the connector no longer has"],"exampleFix":"// before\n\"argument_presets\": { \"tenantID\": ... }\n// after\n\"argument_presets\": { \"tenant_id\": ... }","handlingStrategy":"validation","validationCode":"let coll = schema.collections.iter().find(|c| c.name == collection_name).unwrap();\nlet declared: HashSet<_> = coll.arguments.keys().collect();\nfor name in referenced_ndc_args {\n    assert!(declared.contains(name), \"NDC argument {name} not on collection {collection_name}\");\n}","typeGuard":"fn ndc_argument_defined(name: &DataConnectorArgumentName, coll: &NdcCollection) -> bool {\n    coll.arguments.contains_key(name)\n}","tryCatchPattern":"On NoSuchArgument, print the collection's actual argument names alongside the missing one.","preventionTips":["Generate argument mappings from the connector schema rather than by hand","Diff connector schema on upgrades","Use consistent snake_case naming to avoid case mismatches"],"tags":["ndc","argument-mapping","data-connectors","schema-validation"],"backgroundTag":"unknown-argument-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}