{"record":{"id":"8f7a2330524dc998","repo":"hasura/graphql-engine","slug":"relationship-relationship-name-is-used-in-comp","errorCode":null,"errorMessage":"relationship '{relationship_name}' is used in comparableRelationships in boolean expression type '{object_boolean_expression_type}' does not exist on type '{type_name}'","messagePattern":"relationship '(.+?)' is used in comparableRelationships in boolean expression type '(.+?)' does not exist on type '(.+?)'","errorType":"validation","errorClass":"BooleanExpressionError::UnknownRelationshipInObjectBooleanExpressionType","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/boolean_expressions/error.rs","lineNumber":54,"sourceCode":"        data_connector: Qualified<DataConnectorName>,\n        object_boolean_expression_type: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"unknown data connector object type {data_connector_object_type:} (in data connector {data_connector:}) referenced in object boolean expression type {object_boolean_expression_type:}\"\n    )]\n    UnknownDataConnectorTypeInObjectBooleanExpressionType {\n        data_connector: Qualified<DataConnectorName>,\n        data_connector_object_type: DataConnectorObjectType,\n        object_boolean_expression_type: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"unknown field '{field_name:}' used in object boolean expression type {object_boolean_expression_type:}\"\n    )]\n    UnknownFieldInObjectBooleanExpressionType {\n        field_name: FieldName,\n        object_boolean_expression_type: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"relationship '{relationship_name}' is used in comparableRelationships in boolean expression type '{object_boolean_expression_type}' does not exist on type '{type_name}'\"\n    )]\n    UnknownRelationshipInObjectBooleanExpressionType {\n        relationship_name: RelationshipName,\n        object_boolean_expression_type: Qualified<CustomTypeName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"the object type '{object_type:}' used in boolean expression type {object_boolean_expression_type:} does not have a mapping to object {data_connector_object_type:} of data connector {data_connector:}\"\n    )]\n    NoDataConnectorTypeMappingForObjectTypeInBooleanExpression {\n        object_type: Qualified<CustomTypeName>,\n        object_boolean_expression_type: Qualified<CustomTypeName>,\n        data_connector_object_type: DataConnectorObjectType,\n        data_connector: Qualified<DataConnectorName>,\n    },\n    #[error(\"{error:} in boolean expression type {object_boolean_expression_type:}\")]\n    BooleanExpressionTypeMappingCollectionError {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/boolean_expressions/error.rs#L36-L72","documentation":"An object boolean expression type can declare comparableRelationships so relationship-based comparisons can be generated. This error occurs when a relationship listed there does not exist on the backing object type ('{type_name}'), so the resolver cannot build the relationship comparison expression.","triggerScenarios":"Listing a relationship name under comparableRelationships that is not defined on the backing object type; deleting or renaming a relationship but leaving it in the boolean expression's comparableRelationships list.","commonSituations":"Relationship refactors (rename/move) without updating filter configuration; defining the relationship on a different type than the one backing the boolean expression; typos in relationship names.","solutions":["Check that the relationship in the error is defined on the exact backing object type named in the message","Remove the entry from comparableRelationships if the relationship no longer exists","Fix typos or move the relationship definition onto the correct type","Rebuild metadata"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Every comparableRelationship must exist on the backing object type\nlet rels: HashSet<&str> = object_type.relationships().map(|r| r.name()).collect();\nfor r in boolean_expr.comparable_relationships() {\n    if !rels.contains(r.as_str()) {\n        return Err(format!(\"relationship {r} not defined on backing type\"));\n    }\n}","typeGuard":null,"tryCatchPattern":"match resolve(metadata) {\n    Err(BooleanExpressionError::UnknownRelationshipInObjectBooleanExpressionType { relationship_name, type_name, .. }) => {\n        // add the relationship to the type or drop it from comparableRelationships\n    }\n    other => other,\n}","preventionTips":["Keep comparableRelationships lists in sync with relationship definitions; review them whenever relationships are renamed or moved"],"tags":["hasura","ddn","metadata","boolean-expressions","relationships","rust"],"backgroundTag":"metadata-relationship-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}