{"record":{"id":"c842418b382b9b8b","repo":"hasura/graphql-engine","slug":"found-a-literal-value-but-the-argument-is-a-boolea","errorCode":null,"errorMessage":"Found a literal value but the argument is a boolean expression type '{boolean_expression_type_name}'","messagePattern":"Found a literal value but the argument is a boolean expression type '(.+?)'","errorType":"validation","errorClass":"TypecheckIssue","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/typecheck.rs","lineNumber":43,"sourceCode":"}\n\n#[derive(Error, Debug, PartialEq)]\n/// Issues that can occur when typechecking a value against an object type\npub enum TypecheckIssue {\n    #[error(\"Expected an object value of type {expected:} but got value {actual:}\")]\n    ObjectTypeMismatch {\n        expected: Qualified<CustomTypeName>,\n        actual: serde_json::Value,\n    },\n\n    #[error(\"Typecheck failed for field {field_name:} in object type {object_type:}: {error:}\")]\n    ObjectTypeField {\n        field_name: FieldName,\n        object_type: Qualified<CustomTypeName>,\n        error: TypecheckError,\n    },\n\n    #[error(\n        \"Found a literal value but the argument is a boolean expression type '{boolean_expression_type_name}'\"\n    )]\n    LiteralValueUsedForBooleanExpression {\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n    },\n}\n\nimpl ShouldBeAnError for TypecheckIssue {\n    fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {\n        match self {\n            TypecheckIssue::ObjectTypeField { .. } | TypecheckIssue::ObjectTypeMismatch { .. } => {\n                flags.contains(Flag::TypecheckObjectTypeValuesInPresets)\n            }\n            TypecheckIssue::LiteralValueUsedForBooleanExpression { .. } => {\n                flags.contains(Flag::DisallowLiteralsAsBooleanExpressionArguments)\n            }\n        }\n    }","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/typecheck.rs#L25-L61","documentation":"A TypecheckIssue specific to boolean expression support: a literal value was supplied where the argument is declared to use a named boolean expression type (a filter object). Hasura-style boolean expression arguments expect structured comparison objects like {_eq: 1}, not raw literals.","triggerScenarios":"Providing a primitive literal (e.g. where: true or where: 5) as the value of an argument whose type is a boolean expression object type, instead of a comparison mapping.","commonSituations":"Misunderstanding that a boolean expression argument takes operators ({_eq}, {_gt}, ...) rather than a bare value, or miswiring command argument types in metadata.","solutions":["Replace the literal with a boolean expression object, e.g. {field: {_eq: value}}","Check the argument's declared type in the command and confirm it references the intended boolean expression type"],"exampleFix":"// before\nwhere: true\n\n// after\nwhere:\n  id:\n    _eq: 1","handlingStrategy":"validation","validationCode":"fn is_boolean_expression_literal(v: &serde_json::Value) -> bool {\n    // boolean expression arguments take operator mappings, not primitives\n    v.is_object()\n}","typeGuard":null,"tryCatchPattern":"if let TypecheckIssue::LiteralValueUsedForBooleanExpression { boolean_expression_type_name } = issue {\n    eprintln!(\"use a comparison object for {boolean_expression_type_name:?}, not a literal\");\n}","preventionTips":["Remember filter arguments take operator objects ({_eq: ...})","Document boolean expression shapes for API consumers","Add fixtures covering correct filter usage"],"tags":["metadata","typecheck","boolean-expression","filter"],"backgroundTag":"invalid-filter-expression","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}