hasura/graphql-engine · error · BooleanExpressionError::DifferentDataConnectorInFilterExpression

Model {model:} has source data connector {model_data_connect

Error message

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:}

What it means

A model's filter expression type is resolved against a different data connector than the model's own source connector. Boolean expression types are connector-specific; the filter type of a model must be backed by the same data connector as the model's source.

Source

Thrown at v3/crates/metadata-resolve/src/stages/boolean_expressions/error.rs:171

    FieldLevelComparisonOperatorConfigurationNotSupported,

    #[error(
        "Field level comparison operator configuration is not fully supported yet. Please add all fields in filterable_fields."
    )]
    FieldLevelComparisonOperatorNeedsAllFields,

    #[error("a source must be defined for model {model:} in order to use filter expressions")]
    CannotUseFilterExpressionsWithoutSource { model: Qualified<ModelName> },

    #[error(
        "Target model {model_name:} not found, referenced in relationship {relationship_name:}"
    )]
    TargetModelNotFound {
        relationship_name: RelationshipName,
        model_name: Qualified<ModelName>,
    },

    #[error(
        "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:}"
    )]
    DifferentDataConnectorInFilterExpression {
        model: Qualified<ModelName>,
        model_data_connector: Qualified<DataConnectorName>,
        filter_expression_type: Qualified<CustomTypeName>,
        filter_expression_data_connector: Qualified<DataConnectorName>,
    },
    #[error(
        "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:}"
    )]
    DifferentDataConnectorObjectTypeInFilterExpression {
        model: Qualified<ModelName>,
        model_data_connector_object_type: DataConnectorObjectType,
        filter_expression_type: Qualified<CustomTypeName>,
        filter_expression_data_connector_object_type: DataConnectorObjectType,
    },

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Point the model at a boolean expression type generated for the model's actual data connector
  2. Or change the model's source to the connector the boolean expression type is backed by

Example fix

// before
Album:
  source: { dataConnectorName: postgres, table: albums }
  booleanExpressionType: music.ClickHouse_Album_bool_exp
// after
Album:
  source: { dataConnectorName: postgres, table: albums }
  booleanExpressionType: music.Postgres_Album_bool_exp
Defensive patterns

Strategy: validation

Validate before calling

const modelConnector = model.source.dataConnectorName;
if (connectorOf(boolExpType) !== modelConnector) {
  fail(`boolean expression type connector ${connectorOf(boolExpType)} != model connector ${modelConnector}`);
}

Prevention

When it happens

Trigger: Assigning a booleanExpressionType to a model whose source uses connector A while the boolean expression type's underlying object type was created for connector B (e.g. mixing a Postgres model with a filter type generated for a ClickHouse connector).

Common situations: Copying a boolean expression type from another connector's metadata; changing a model's source connector without regenerating its boolean expression types; multi-connector projects with similarly named filter types.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/44c2cda427b337c0. Report an issue: GitHub.