{"record":{"id":"dbf7f7ce528a835f","repo":"hasura/graphql-engine","slug":"field-field-name-could-not-be-found-in-boolea","errorCode":null,"errorMessage":"field '{field_name:}' could not be found in boolean expression type for object type '{type_name:}'","messagePattern":"field '(.+?)' could not be found in boolean expression type for object type '(.+?)'","errorType":"validation","errorClass":"TypePredicateError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":425,"sourceCode":"        \"field '{field_name:}' of type '{type_name:}' is an array type and cannot be used in a nested field predicate\"\n    )]\n    ArrayFieldInNestedFieldPredicate {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"unknown field '{field_name}' for type '{type_name}' used in target mapping for relationship '{relationship_name}'\"\n    )]\n    UnknownFieldInModelRelationshipTargetMapping {\n        field_name: FieldName,\n        type_name: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n    },\n    #[error(\"boolean expression '{boolean_expression_name:}' not found\")]\n    BooleanExpressionNotFound {\n        boolean_expression_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"field '{field_name:}' could not be found in boolean expression type for object type '{type_name:}'\"\n    )]\n    BooleanExpressionFieldNotFound {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"the source data connector {data_connector:} for type {type_name:} has not been defined\"\n    )]\n    UnknownTypeDataConnector {\n        type_name: Qualified<CustomTypeName>,\n        data_connector: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"field '{field_name}' of type '{type_name}' used in a field comparison has the unknown NDC type '{ndc_type_name}' and therefore cannot be compared to a single value\"\n    )]\n    UnsupportedFieldComparisonToUnknownType {\n        field_name: Spanned<FieldName>,","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L407-L443","documentation":"A predicate references a field that is not part of the boolean expression type generated/declared for the given object type. This is the filtering-path variant of 'field not found': the field may exist on the object type, but the filter input type for that object does not expose it.","triggerScenarios":"Filtering on a field omitted from the object's boolean expression type; using a hand-written filterExpressionType that skips fields; filtering on fields added after the boolean expression type was authored.","commonSituations":"Custom boolean expression types drifting out of sync with the model; newly added model fields not added to the filter type; filtering on fields marked non-filterable.","solutions":["Compare the filter input fields for `type_name` with the `field_name` you used","Add the field to the boolean expression type (or remove the filterExpressionType override so the default generated one includes it)","Filter on a field that the boolean expression type actually exposes"],"exampleFix":"# before\ntypes:\n  UserBoolExpr:\n    fields: {id: ..., name: ...}\n# filter on 'email' fails\n# after: add email to the expression type (or drop the custom type)\ntypes:\n  UserBoolExpr:\n    fields: {id: ..., name: ..., email: ...}\n","handlingStrategy":"validation","validationCode":"// Confirm the field exists in the type's boolean expression before filtering\nif !bool_expr_type.data_fields.contains_key(&field_name) {\n    return Err(\"field not in boolean expression type\".into());\n}","typeGuard":"fn in_bool_expr(e: &BooleanExpressionType, f: &FieldName) -> bool {\n    e.data_fields.contains_key(f)\n}","tryCatchPattern":"if let Err(TypePredicateError::BooleanExpressionFieldNotFound { field_name, type_name }) = result {\n    // add field to the expression type or choose another field\n}","preventionTips":["Sync custom expression types whenever model fields change","Prefer generated default expression types unless customization is required"],"tags":["metadata","boolean-expression","filter","hasura"],"backgroundTag":"unknown-field-in-filter","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}