{"record":{"id":"0bc3dac479b32790","repo":"hasura/graphql-engine","slug":"an-issue-occurred-while-mapping-arguments-in-the-m","errorCode":null,"errorMessage":"An issue occurred while mapping arguments in the model {model_name:} to the collection {collection_name:} in the data connector {data_connector_name:}: {issue:}","messagePattern":"An issue occurred while mapping arguments in the model (.+?) to the collection (.+?) in the data connector (.+?): (.+?)","errorType":"validation","errorClass":"ModelsIssue","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/models/types.rs","lineNumber":99,"sourceCode":"}\n\n#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]\npub enum ModelOrderBy {\n    ModelV1 {\n        graphql_type_name: Option<GraphQlTypeName>,\n        orderable_fields: Vec<OrderableField>,\n    },\n    ModelV2(Option<open_dds::order_by_expression::OrderByExpressionName>),\n}\n\n#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]\npub struct NDCFieldSourceMapping {\n    pub ndc_mapping: BTreeMap<FieldName, NdcColumnForComparison>,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum ModelsIssue {\n    #[error(\n        \"An issue occurred while mapping arguments in the model {model_name:} to the collection {collection_name:} in the data connector {data_connector_name:}: {issue:}\"\n    )]\n    FunctionArgumentMappingIssue {\n        data_connector_name: Qualified<DataConnectorName>,\n        model_name: Qualified<ModelName>,\n        collection_name: CollectionName,\n        issue: ArgumentMappingIssue,\n    },\n    #[error(\n        \"The orderable field '{field_name}' in model '{model_name}' is not a scalar field (type: {field_type}) and therefore cannot be used for ordering. Upgrade to version 2 Models and use OrderByExpressions to order by nested fields\"\n    )]\n    ModelV1OrderableFieldIsNotAScalarField {\n        model_name: Qualified<ModelName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"The orderable field '{field_name}' in model '{model_name}' is an array type (type: {field_type}) and therefore cannot be used for ordering\"","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/models/types.rs#L81-L117","documentation":"While resolving a model whose source is a data connector command/collection, one of the model argument mappings could not be translated to the connector's representation. The underlying ArgumentMappingIssue is included in the message.","triggerScenarios":"A model with arguments (model v2 / command) where an argument type or mapping has no equivalent column/type in the target collection, e.g. an object-typed argument mapped against a scalar column.","commonSituations":"Defining model commands with argument mappings that don't line up with the underlying collection fields; renaming collection columns without updating argument mappings.","solutions":["Inspect the appended ArgumentMappingIssue detail and fix that specific mapping","Ensure the argument's type matches the target collection column type","Remove or remap arguments that reference non-existent collection fields"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check that each model argument maps to an existing, type-compatible collection field\nfor (arg, mapping) in &model.argument_mappings {\n    let col = collection.columns.iter().find(|c| c.name == mapping.target)\n        .unwrap_or_else(|| panic!(\"argument {arg} maps to unknown column\"));\n    assert!(types_compatible(&arg.type_, &col.type_));\n}","typeGuard":null,"tryCatchPattern":"catch (e) { if (e.message.includes('mapping arguments')) reportArgumentIssue(e); }","preventionTips":["Keep argument types aligned with collection column types","Rename columns and argument mappings together"],"tags":["hasura","metadata","model-arguments","ndc","mapping"],"backgroundTag":"argument-mapping-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}