{"record":{"id":"5b4105064d9b5dd9","repo":"hasura/graphql-engine","slug":"the-operand-type-operand-type-does-not-match-t-5b4105","errorCode":null,"errorMessage":"the operand type '{operand_type}' does not match the type of the model '{model_name}': '{model_type}'","messagePattern":"the operand type '(.+?)' does not match the type of the model '(.+?)': '(.+?)'","errorType":"validation","errorClass":"AggregateBooleanExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs","lineNumber":358,"sourceCode":"    ComparableRelationshipBooleanExpressionIncorrectOperandType {\n        relationship_name: open_dds::relationships::RelationshipName,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\n        \"the object type of the target of the relationship '{relationship_name}' ({relationship_target_object_type}) does not match the operand type of the boolean expression type '{boolean_expression_type}': '{boolean_expression_operand_type}'\"\n    )]\n    ComparableRelationshipBooleanExpressionTypeMismatch {\n        relationship_name: open_dds::relationships::RelationshipName,\n        relationship_target_object_type: Qualified<CustomTypeName>,\n        boolean_expression_type: Qualified<CustomTypeName>,\n        boolean_expression_operand_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\"the filter input model '{model_name}' cannot be found\")]\n    FilterInputModelNotFound { model_name: Qualified<ModelName> },\n\n    #[error(\n        \"the operand type '{operand_type}' does not match the type of the model '{model_name}': '{model_type}'\"\n    )]\n    FilterInputModelTypeMismatch {\n        operand_type: Qualified<CustomTypeName>,\n        model_name: Qualified<ModelName>,\n        model_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\n        \"a GraphQL field name conflict exists between the '{name}' {name_source_1} and the '{name}' {name_source_2}. One of these will need to be renamed.\"\n    )]\n    GraphqlNameConflict {\n        name: String,\n        name_source_1: NameSource,\n        name_source_2: NameSource,\n    },\n}\n","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregate_boolean_expressions/types.rs#L340-L376","documentation":"The filter input model referenced by the aggregate boolean expression exists, but the model's underlying type does not match the operand type required by the boolean expression. The filter input model must be typed on the same object type as the operand it filters.","triggerScenarios":"A filter input model whose model_type is object type A while the boolean expression operand type is B, e.g. reusing a UserFilter model for an Article operand.","commonSituations":"Sharing one filter model across types; changing a model's underlying type after wiring it into boolean expressions; refactoring operand types without updating filter input models.","solutions":["Point filter_input at a model whose type equals the operand type shown in the error.","Or create a new filter input model on the correct object type and reference it.","If the model type is genuinely wrong, update the model's underlying type to the operand type."],"exampleFix":"# before\n# operand type: Article\nfilter_input:\n  model_name: UserFilter  # model_type: User\n# after\n# operand type: Article\nfilter_input:\n  model_name: ArticleFilter  # model_type: Article","handlingStrategy":"validation","validationCode":"for be in &metadata.boolean_expression_types {\n    if let Some(fi) = &be.filter_input {\n        let model = &models_by_name[&fi.model_name];\n        assert_eq!(model.underlying_type, be.operand_type,\n            \"filter model {} is typed {} but operand is {}\",\n            fi.model_name, model.underlying_type, be.operand_type);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never share one filter model across different object types.","Name filter models after the object type they filter (ArticleFilter for Article)."],"tags":["metadata","type-mismatch","filter-input","model"],"backgroundTag":"metadata-validation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}