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

unknown field ' ' used in object boolean expression type

Error message

unknown field '{field_name:}' used in object boolean expression type {object_boolean_expression_type:}

What it means

During boolean expression construction, each comparison operator defined on an object boolean expression type must name a real field of the backing object type. This error fires when an operator (or comparable field) references a field name that does not exist on that object type.

Solutions

  1. Compare the field name in the error against the backing object type's field list
  2. Fix or remove the operator/comparable field entry referencing the unknown field
  3. If the field was renamed, update the boolean expression config to the new name
  4. Rebuild metadata

Example fix

# before
filter:
  operators:
    my_sub.SomeBooleanExpression:
      fields:
      - name: emial   # typo
# after
filter:
  operators:
    my_sub.SomeBooleanExpression:
      fields:
      - name: email
Defensive patterns

Strategy: validation

Validate before calling

// Every operator/comparable field must exist on the backing object type
let fields: HashSet<&str> = object_type.fields().map(|f| f.name()).collect();
for f in boolean_expr.filterable_fields() {
    if !fields.contains(f.as_str()) {
        return Err(format!("field {f} does not exist on backing object type"));
    }
}

Try / catch

match resolve(metadata) {
    Err(BooleanExpressionError::UnknownFieldInObjectBooleanExpressionType { field_name, object_boolean_expression_type }) => {
        // fix or drop the operator referencing field_name
    }
    other => other,
}

Prevention

When it happens

Trigger: Defining filter operators on a boolean expression type that reference field names not present on the backing object type; renaming or removing a field from the object type without updating the boolean expression's operator definitions.

Common situations: Field renames in the object type after filter configuration was authored; typos in field names inside object boolean expression operator config; mismatched casing of field identifiers.

Related errors


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

Appendix: source

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

        boolean_expression_type_name: Qualified<CustomTypeName>,
        type_name: Qualified<CustomTypeName>,
    },
    #[error(
        "unknown data connector {data_connector:} referenced in object boolean expression type {object_boolean_expression_type:}"
    )]
    UnknownDataConnectorInObjectBooleanExpressionType {
        data_connector: Qualified<DataConnectorName>,
        object_boolean_expression_type: Qualified<CustomTypeName>,
    },
    #[error(
        "unknown data connector object type {data_connector_object_type:} (in data connector {data_connector:}) referenced in object boolean expression type {object_boolean_expression_type:}"
    )]
    UnknownDataConnectorTypeInObjectBooleanExpressionType {
        data_connector: Qualified<DataConnectorName>,
        data_connector_object_type: DataConnectorObjectType,
        object_boolean_expression_type: Qualified<CustomTypeName>,
    },
    #[error(
        "unknown field '{field_name:}' used in object boolean expression type {object_boolean_expression_type:}"
    )]
    UnknownFieldInObjectBooleanExpressionType {
        field_name: FieldName,
        object_boolean_expression_type: Qualified<CustomTypeName>,
    },
    #[error(
        "relationship '{relationship_name}' is used in comparableRelationships in boolean expression type '{object_boolean_expression_type}' does not exist on type '{type_name}'"
    )]
    UnknownRelationshipInObjectBooleanExpressionType {
        relationship_name: RelationshipName,
        object_boolean_expression_type: Qualified<CustomTypeName>,
        type_name: Qualified<CustomTypeName>,
    },
    #[error(
        "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:}"
    )]
    NoDataConnectorTypeMappingForObjectTypeInBooleanExpression {

View on GitHub (pinned to 724551b9ae)