{"record":{"id":"0f51369cbfe771d2","repo":"hasura/graphql-engine","slug":"the-field-field-name-has-type-field-type-but","errorCode":null,"errorMessage":"The field {field_name:} has type {field_type:} but the field's boolean expression type {field_boolean_expression_type_name:} has type {underlying_type:}","messagePattern":"The field (.+?) has type (.+?) but the field's boolean expression type (.+?) has type (.+?)","errorType":"validation","errorClass":"BooleanExpressionError::FieldTypeMismatch","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/boolean_expressions/error.rs","lineNumber":132,"sourceCode":"    #[error(\n        \"The data connector '{data_connector_name}' does not support filtering inside nested objects. The comparable field '{field_name}' within '{boolean_expression_type_name}' is of a nested object type: {field_type}\"\n    )]\n    DataConnectorDoesNotSupportNestedObjectFiltering {\n        data_connector_name: Qualified<DataConnectorName>,\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"The data connector '{data_connector_name}' does not support filtering across nested relationships. The nested object field '{field_name}' within '{parent_boolean_expression_type_name}' references the boolean expression type '{nested_boolean_expression_type_name}' which has relationship comparisons, making them nested relationship comparisons.\"\n    )]\n    DataConnectorDoesNotSupportNestedRelationshipFiltering {\n        data_connector_name: Qualified<DataConnectorName>,\n        field_name: FieldName,\n        parent_boolean_expression_type_name: Qualified<CustomTypeName>,\n        nested_boolean_expression_type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"The field {field_name:} has type {field_type:} but the field's boolean expression type {field_boolean_expression_type_name:} has type {underlying_type:}\"\n    )]\n    FieldTypeMismatch {\n        field_name: FieldName,\n        field_type: QualifiedTypeName,\n        field_boolean_expression_type_name: BooleanExpressionTypeIdentifier,\n        underlying_type: QualifiedTypeName,\n    },\n\n    #[error(\n        \"Scalar representations for data connector '{data_connector_name}' could not found for boolean expression type {boolean_expression_type}\"\n    )]\n    DataConnectorScalarRepresentationsNotFound {\n        data_connector_name: Qualified<DataConnectorName>,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/boolean_expressions/error.rs#L114-L150","documentation":"Thrown while resolving a model's boolean expression (filter input) type: the type of a field on the boolean expression type does not match the type of the underlying model field it filters. The metadata declares a boolean_expression_type whose field maps to a model field with a different type, so the generated filter expression would be unsound.","triggerScenarios":"Defining an open-dds boolean_expressionType for a model where a field in the expression object type has a different type than the corresponding field on the target model; e.g. the model field is Float but the expression type declares it as Int, or a renamed/mismatched type after a metadata refactor.","commonSituations":"Hand-written OpenDDs YAML where the filter object type drifts from the model type; changing a model field's type without updating the corresponding boolean expression type; copying a boolean expression type from another model.","solutions":["Compare each field in the boolean expression object type with the matching field on the model and align their types exactly","If the model field type changed, update the boolean_expression_type field to the new type","Regenerate or re-derive the boolean expression type from the model instead of maintaining it by hand"],"exampleFix":"// before (model field is Float, expression declares Int)\nbooleanExpressionType:\n  fields:\n    rating: Int!\n// after\nbooleanExpressionType:\n  fields:\n    rating: Float!","handlingStrategy":"validation","validationCode":"// before applying metadata, assert each boolean expression field type matches the model field type\nfunction assertFieldTypeMatches(model, boolExpType) {\n  for (const f of Object.values(boolExpType.fields)) {\n    const m = model.fields[f.name];\n    if (!m) throw new Error(`unknown model field ${f.name}`);\n    if (String(m.type) !== String(f.type)) {\n      throw new Error(`type mismatch on ${f.name}: model=${m.type} expr=${f.type}`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate boolean expression types from the model definition instead of hand-writing them","Run metadata CI validation (hasura metadata build/resolve) on every metadata change","Diff boolean expression types against model types when changing field types"],"tags":["hasura","metadata","boolean-expression","type-mismatch","open-dds"],"backgroundTag":"schema-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}