{"record":{"id":"1d91e4ebaeef5781","repo":"hasura/graphql-engine","slug":"the-relationship-relationship-name-cannot-be-u","errorCode":null,"errorMessage":"The relationship '{relationship_name}' cannot be used as a comparable relationship in boolean expression type '{boolean_expression_type_name}' because it is a remote relationship with an argument mapping target. Relationship '{relationship_name}' on type '{source_type}' has source field '{source_field}' mapped to target argument '{target_argument}'","messagePattern":"The relationship '(.+?)' cannot be used as a comparable relationship in boolean expression type '(.+?)' because it is a remote relationship with an argument mapping target\\. Relationship '(.+?)' on type '(.+?)' has source field '(.+?)' mapped to target argument '(.+?)'","errorType":"validation","errorClass":"BooleanExpressionError::RemoteComparableRelationshipWithArgumentMappingTargetNotSupported","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/boolean_expressions/error.rs","lineNumber":190,"sourceCode":"        \"Model {model:} has source data connector {model_data_connector:} but its filter expression type {filter_expression_type:} is backed by data connector {filter_expression_data_connector:}\"\n    )]\n    DifferentDataConnectorInFilterExpression {\n        model: Qualified<ModelName>,\n        model_data_connector: Qualified<DataConnectorName>,\n        filter_expression_type: Qualified<CustomTypeName>,\n        filter_expression_data_connector: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"Model {model:} has source data connector object type {model_data_connector_object_type:} but its filter expression type {filter_expression_type:} is backed by data connector {filter_expression_data_connector_object_type:}\"\n    )]\n    DifferentDataConnectorObjectTypeInFilterExpression {\n        model: Qualified<ModelName>,\n        model_data_connector_object_type: DataConnectorObjectType,\n        filter_expression_type: Qualified<CustomTypeName>,\n        filter_expression_data_connector_object_type: DataConnectorObjectType,\n    },\n\n    #[error(\n        \"The relationship '{relationship_name}' cannot be used as a comparable relationship in boolean expression type '{boolean_expression_type_name}' because it is a remote relationship with an argument mapping target. Relationship '{relationship_name}' on type '{source_type}' has source field '{source_field}' mapped to target argument '{target_argument}'\"\n    )]\n    RemoteComparableRelationshipWithArgumentMappingTargetNotSupported {\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n        relationship_name: open_dds::relationships::RelationshipName,\n        source_type: Qualified<CustomTypeName>,\n        source_field: FieldName,\n        target_argument: open_dds::query::ArgumentName,\n    },\n\n    #[error(\"{0}\")]\n    GraphqlConfigError(#[from] graphql_config::GraphqlConfigError),\n\n    #[error(\"{0}\")]\n    ScalarBooleanExpressionTypeError(\n        #[from] scalar_boolean_expressions::ScalarBooleanExpressionTypeError,\n    ),\n","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/boolean_expressions/error.rs#L172-L208","documentation":"A relationship used as a comparable/filterable relationship inside a boolean expression type is a remote relationship whose source field maps to a target argument. Argument-mapped remote relationships cannot be used inside filter expressions, so resolution rejects them.","triggerScenarios":"Including a remote relationship in a boolean expression type (to filter across it) where the relationship's mapping maps a source field to an argument on the target rather than to a target field comparison.","commonSituations":"Trying to filter a model by a field of a remote relationship (e.g. remote join to another subgraph) when that relationship passes a source field as an argument to the remote query; typical in federation/remote-relationship setups.","solutions":["Remove the argument-mapped remote relationship from the boolean expression type's comparable/filterable relationships","Change the remote relationship mapping so source fields map to target fields rather than target arguments, if the remote API allows it","Perform the filtering on the remote side via a command/permission rule instead of the boolean expression type"],"exampleFix":"// before: relationship maps source field to target argument\nrelationships:\n  authors:\n    mapping:\n      - sourceField: author_id\n        targetArgument: id\n// after: map to a target field\nrelationships:\n  authors:\n    mapping:\n      - sourceField: author_id\n        targetField: id","handlingStrategy":"validation","validationCode":"for (const rel of boolExpRelationships(boolExpType)) {\n  const r = relationshipByName(rel);\n  if (r.kind === 'remote' && r.mapping.some(m => m.targetArgument)) {\n    fail(`remote relationship ${rel} maps to a target argument; not usable in filters`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Map remote relationship source fields to target fields, not arguments, when filters are needed","Keep argument-based remote relationships out of boolean expression types"],"tags":["hasura","remote-relationship","boolean-expression","argument-mapping"],"backgroundTag":"unsupported-remote-relationship","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}