{"record":{"id":"b119ee804e6c4395","repo":"hasura/graphql-engine","slug":"field-field-name-of-type-type-name-used-in-b119ee","errorCode":null,"errorMessage":"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","messagePattern":"field '(.+?)' of type '(.+?)' used in a field comparison is a predicate type and therefore cannot be compared to a single value","errorType":"validation","errorClass":"TypePredicateError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":457,"sourceCode":"    #[error(\n        \"field '{field_name}' of type '{type_name}' used in a field comparison has the unknown NDC type '{ndc_type_name}' and therefore cannot be compared to a single value\"\n    )]\n    UnsupportedFieldComparisonToUnknownType {\n        field_name: Spanned<FieldName>,\n        field_type: QualifiedTypeReference,\n        type_name: Qualified<CustomTypeName>,\n        ndc_type_name: ndc_models::TypeName,\n    },\n\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(","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L439-L475","documentation":"A field comparison to a single value was attempted on a field whose type is itself a predicate/boolean-expression type. Predicate types are structured filter inputs, not comparable scalars, so comparing them to a single value is meaningless and rejected.","triggerScenarios":"Applying `_eq`-style operators to a field typed as a boolean expression/predicate input; nesting a filter-expression field inside another comparison; accidental self-referential filter types in metadata.","commonSituations":"Mis-designed filterExpressionType that includes another expression type as a plain field; generic client code applying equality to every field including expression-typed ones.","solutions":["Remove the single-value comparison on the predicate-typed field","If you meant to combine filters, use boolean operators (`_and`/`_or`/`_not`) over the expression, not `_eq` on it","Redesign the boolean expression type so its fields are comparable scalars or nested expressions used correctly"],"exampleFix":"// before\n{\"field\": \"userFilter\", \"operator\": \"_eq\", \"value\": {...}}\n// after: apply the nested expression directly\n{\"field\": \"user\", \"operator\": \"_and\", \"value\": [{\"field\": \"age\", \"operator\": \"_gt\", \"value\": 18}]}\n","handlingStrategy":"type-guard","validationCode":"// Guard: fields whose type is a predicate type must not be value-compared\nif is_predicate_type(&field_type) {\n    return Err(\"cannot compare predicate-typed field to a value\".into());\n}","typeGuard":"fn is_predicate_type(fr: &QualifiedTypeReference, expr_types: &HashSet<Qualified<CustomTypeName>>) -> bool {\n    matches!(fr.underlying_type(), UnderlyingType::Named(n) if expr_types.contains(n))\n}","tryCatchPattern":"if let Err(TypePredicateError::UnsupportedFieldComparisonToPredicateType { field_name, .. }) = result {\n    // restructure using boolean combinators\n}","preventionTips":["Keep expression types out of comparable field sets","Use _and/_or/_not to combine expressions, never _eq"],"tags":["filter","predicate","field-comparison","hasura","metadata"],"backgroundTag":"invalid-filter-operator","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}