{"record":{"id":"67b3dbd89f75896c","repo":"hasura/graphql-engine","slug":"invalid-operator-used-in-type-type-name-predi","errorCode":null,"errorMessage":"Invalid operator used in type '{type_name:}' predicate: '{operator_name:}'","messagePattern":"Invalid operator used in type '(.+?)' predicate: '(.+?)'","errorType":"validation","errorClass":"TypePredicateError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":466,"sourceCode":"\n    #[error(\n        \"field '{field_name}' of type '{type_name}' used in a field comparison is an array type and therefore cannot be compared to a single value\"\n    )]\n    UnsupportedFieldComparisonToArrayType {\n        field_name: Spanned<FieldName>,\n        field_type: QualifiedTypeReference,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[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    )]","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L448-L484","documentation":"A type predicate used an operator name that is not valid for that type's boolean expression. Each boolean expression type exposes a fixed operator vocabulary; referencing any other operator string fails resolution with the type and offending operator name.","triggerScenarios":"Using an operator like `_regex`, `_ilike`, or a custom name not defined in the type's predicate operators; typos in operator names; assuming Postgres-style operators exist on non-Postgres connectors.","commonSituations":"Switching connectors (e.g. Postgres to DynamoDB) while keeping the same filters; connector not supporting a given operator on a type; custom boolean expressions with a restricted operator set.","solutions":["Check `operator_name` for typos (e.g. `_eque` -> `_eq`)","Look up the operators the type's boolean expression actually supports and use one of those","Enable/map the operator in the connector's metadata or boolean expression definition if it should be supported","Test filters per-connector rather than assuming a universal operator set"],"exampleFix":"// before\n{\"field\": \"name\", \"operator\": \"_equals\", \"value\": \"bob\"}\n// after\n{\"field\": \"name\", \"operator\": \"_eq\", \"value\": \"bob\"}\n","handlingStrategy":"validation","validationCode":"// Validate operators against the type's declared predicate operators\nif !type_predicate.operators.contains_key(&operator_name) {\n    return Err(format!(\"operator {operator_name} not valid for type\"));\n}","typeGuard":"fn operator_valid(tp: &TypePredicate, op: &OperatorName) -> bool {\n    tp.operators.contains_key(op)\n}","tryCatchPattern":"if let Err(TypePredicateError::InvalidOperatorInTypePredicate { type_name, operator_name }) = result {\n    return Err(format!(\"{operator_name} unsupported on {type_name}; check available operators\"));\n}","preventionTips":["Derive operator choice from the connector/expression schema, not hardcoding","Add filter unit tests per connector type"],"tags":["filter","operator","predicate","hasura","metadata"],"backgroundTag":"invalid-filter-operator","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}