{"record":{"id":"a562f2e883061490","repo":"hasura/graphql-engine","slug":"the-target-argument-argument-name-of-command-co","errorCode":null,"errorMessage":"The target argument {argument_name} of command {command_name} has been mapped more than once in the relationship {relationship_name} on type {type_name}","messagePattern":"The target argument (.+?) of command (.+?) has been mapped more than once in the relationship (.+?) on type (.+?)","errorType":"validation","errorClass":"RelationshipError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/object_relationships/error.rs","lineNumber":94,"sourceCode":"    },\n    #[error(\n        \"Mapping for source field {field_name} already exists in the relationship {relationship_name} on type {type_name}\"\n    )]\n    MappingExistsInRelationship {\n        type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        relationship_name: RelationshipName,\n    },\n    #[error(\n        \"The target argument {argument_name} of model {model_name} has been mapped more than once in the relationship {relationship_name} on type {type_name}\"\n    )]\n    ModelArgumentMappingExistsInRelationship {\n        argument_name: ArgumentName,\n        model_name: Qualified<ModelName>,\n        relationship_name: RelationshipName,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"The target argument {argument_name} of command {command_name} has been mapped more than once in the relationship {relationship_name} on type {type_name}\"\n    )]\n    CommandArgumentMappingExistsInRelationship {\n        argument_name: ArgumentName,\n        command_name: Qualified<CommandName>,\n        relationship_name: RelationshipName,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"No mapping for target command argument {argument_name} in the relationship {relationship_name} on type {type_name}\"\n    )]\n    MissingArgumentMappingInRelationship {\n        type_name: Qualified<CustomTypeName>,\n        argument_name: ArgumentName,\n        relationship_name: RelationshipName,\n    },\n    #[error(\n        \"The target data connector {data_connector_name} for relationship {relationship_name} on type {type_name} does not support the variables capability\"","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/object_relationships/error.rs#L76-L112","documentation":"Two or more mappings in one relationship assign values to the same target argument of the target command. Command arguments must be mapped at most once per relationship.","triggerScenarios":"Duplicate argument mappings targeting the same command argument within a single command-based relationship.","commonSituations":"Merged metadata contributions adding conflicting mappings; refactoring that leaves a stale duplicate.","solutions":["Find the colliding target-argument entries in the relationship's mappings","Keep exactly one mapping per command argument and delete the duplicates"],"exampleFix":"// before\nargument_mappings:\n  id: author_id\n  id: author_slug   # duplicate target argument 'id'\n// after\nargument_mappings:\n  id: author_id","handlingStrategy":"validation","validationCode":"const argTargets = Object.values(rel.argument_mappings ?? {});\nconst dupes = argTargets.filter((t, i) => argTargets.indexOf(t) !== i);\nif (dupes.length) throw new Error(`command argument mapped twice: ${dupes}`);","typeGuard":null,"tryCatchPattern":"try { await applyMetadata(md); } catch (e) { if (/of command .* has been mapped more than once/.test(e.message)) { /* dedupe */ } throw e; }","preventionTips":["When merging metadata sources, dedupe target-argument mappings per relationship"],"tags":["metadata","relationships","argument-mapping","command","duplicate"],"backgroundTag":"metadata-relationship-validation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}