{"record":{"id":"125732db2d453a58","repo":"hasura/graphql-engine","slug":"the-comparable-relationship-relationship-name-125732","errorCode":null,"errorMessage":"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' targets a model than cannot be found: '{target_model_name}'","messagePattern":"the comparable relationship '(.+?)' for the operand type '(.+?)' targets a model than cannot be found: '(.+?)'","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":319,"sourceCode":"    },\n\n    #[error(\n        \"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' targets a command. This is not supported\"\n    )]\n    ComparableRelationshipCommandTargetNotSupported {\n        operand_type: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n    },\n\n    #[error(\n        \"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' is an array relationship. This is not supported\"\n    )]\n    ComparableArrayRelationshipNotSupported {\n        operand_type: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n    },\n\n    #[error(\n        \"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' targets a model than cannot be found: '{target_model_name}'\"\n    )]\n    ComparableRelationshipTargetModelNotFound {\n        operand_type: Qualified<CustomTypeName>,\n        relationship_name: open_dds::relationships::RelationshipName,\n        target_model_name: Qualified<open_dds::models::ModelName>,\n    },\n\n    #[error(\n        \"the comparable relationship '{relationship_name}' for the operand type '{operand_type}' references a boolean expression type that cannot be found: '{boolean_expression_type}'\"\n    )]\n    ComparableRelationshipBooleanExpressionNotFound {\n        operand_type: Qualified<CustomTypeName>,\n        relationship_name: open_dds::relationships::RelationshipName,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L301-L337","documentation":"A comparable relationship resolves to a target model by qualified name, but that model cannot be found in the resolved metadata. Without the target model, the resolver cannot compute the target's boolean expression/aggregation types and aborts.","triggerScenarios":"The relationship's target model qualified name (subgraph + ModelName) does not match any model present in the metadata being resolved.","commonSituations":"Renaming or deleting a model without updating relationships pointing at it; subgraph name changes making the qualified target stale; referencing a model defined in another subgraph/project that is not part of the build.","solutions":["Verify the target model exists under the exact qualified name (subgraph::ModelName) the relationship references","Fix stale references after model renames or subgraph renames","If the model lives elsewhere, include that subgraph/metadata source in the build or add the model locally"],"exampleFix":"# before\nrelationship:\n  name: author\n  target: { model: { name: Author, subgraph: old } }   # subgraph renamed to 'content'\n\n# after\nrelationship:\n  name: author\n  target: { model: { name: Author, subgraph: content } }","handlingStrategy":"validation","validationCode":"for r in &comparable_relationships {\n    if let Some(model) = r.target_model() {\n        assert!(models.contains_key(model), \"target model {} not found\", model);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate all relationship target references against the model catalog before resolve","Keep subgraph names stable or run a codemod when renaming them"],"tags":["rust","hasura","metadata","model-not-found","relationships"],"backgroundTag":"target-model-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}