{"record":{"id":"3e50573a1cbf928f","repo":"hasura/graphql-engine","slug":"no-boolean-expression-found-for-type-type-name","errorCode":null,"errorMessage":"no boolean expression found for type '{type_name:}' This is required when filtering a nested field. Please ensure the model you are filtering has a filterExpressionType defined.","messagePattern":"no boolean expression found for type '(.+?)' This is required when filtering a nested field\\. Please ensure the model you are filtering has a filterExpressionType defined\\.","errorType":"validation","errorClass":"TypePredicateError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":475,"sourceCode":"    #[error(\n        \"field '{field_name}' of type '{type_name}' used in a field comparison is a predicate type and therefore cannot be compared to a single value\"\n    )]\n    UnsupportedFieldComparisonToPredicateType {\n        field_name: Spanned<FieldName>,\n        field_type: QualifiedTypeReference,\n        type_name: Qualified<CustomTypeName>,\n    },\n\n    #[error(\"Invalid operator used in type '{type_name:}' predicate: '{operator_name:}'\")]\n    InvalidOperatorInTypePredicate {\n        type_name: Qualified<CustomTypeName>,\n        operator_name: Spanned<OperatorName>,\n    },\n    #[error(\"Nested predicate used in type '{type_name:}'\")]\n    NestedPredicateInTypePredicate {\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"no boolean expression found for type '{type_name:}' This is required when filtering a nested field. Please ensure the model you are filtering has a filterExpressionType defined.\"\n    )]\n    NoBooleanExpressionFields {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"relationship '{relationship_name}' is used in predicate but does not exist for type '{type_name}'\"\n    )]\n    UnknownRelationshipInTypePredicate {\n        relationship_name: Spanned<RelationshipName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"relationship '{relationship_name}' is used in predicate but does not exist in comparableRelationships in boolean expression '{boolean_expression_type_name}'\"\n    )]\n    RelationshipNotComparableInTypePredicate {\n        relationship_name: Spanned<RelationshipName>,","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L457-L493","documentation":"Filtering on a nested field requires the filtered model to have a `filterExpressionType` (boolean expression type) defined, but none was found for the type in question. Without a boolean expression type the resolver has no input shape for filters on that type, so nested-field filtering cannot proceed.","triggerScenarios":"Applying a filter that descends into a nested/relationship field of a model whose metadata lacks `filterExpressionType`; using custom metadata where you omitted filter types to slim the schema.","commonSituations":"Deliberately omitting boolean expression types to reduce schema size, then adding filters later; new models created by copying a minimal template without filter types; nested filtering enabled after initial metadata was authored.","solutions":["Add `filterExpressionType` to the model named by `type_name` pointing at a valid boolean expression type","Ensure that boolean expression type includes the nested field you are filtering on","If you don't need filtering, remove the filter from the request/query rather than adding metadata"],"exampleFix":"# before\nmodels:\n  users: {source: {...}}   # no filterExpressionType\n# after\nmodels:\n  users:\n    source: {...}\n    filterExpressionType: UserBooleanExpression\n","handlingStrategy":"validation","validationCode":"// Before allowing nested-field filters, confirm the model has a filterExpressionType\nif model.filter_expression_type.is_none() {\n    return Err(\"model lacks filterExpressionType; nested filtering unsupported\".into());\n}","typeGuard":"fn supports_nested_filter(m: &Model) -> bool {\n    m.filter_expression_type.is_some()\n}","tryCatchPattern":"if let Err(TypePredicateError::NoBooleanExpressionFields { type_name, .. }) = result {\n    // add filterExpressionType to the model or drop the nested filter\n}","preventionTips":["Always set filterExpressionType on models intended to be filterable","Include filter capability checks in API acceptance tests"],"tags":["filter","boolean-expression","nested-field","metadata","hasura"],"backgroundTag":"missing-filter-expression-type","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}