{"record":{"id":"8043420ec4239df6","repo":"hasura/graphql-engine","slug":"field-field-name-of-type-type-name-used-in-804342","errorCode":null,"errorMessage":"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","messagePattern":"field '(.+?)' of type '(.+?)' used in a field comparison is an array 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":449,"sourceCode":"    },\n    #[error(\n        \"the source data connector {data_connector:} for type {type_name:} has not been defined\"\n    )]\n    UnknownTypeDataConnector {\n        type_name: Qualified<CustomTypeName>,\n        data_connector: Qualified<DataConnectorName>,\n    },\n    #[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 {","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L431-L467","documentation":"A field comparison against a single value (e.g. `_eq`) was applied to a field of array type. Arrays cannot be ordered-compared to a single scalar; they require array-specific operators such as `_contains` or dedicated array comparison support.","triggerScenarios":"Using `_eq`, `_lt`, `_gt` etc. on a list-typed field (`field_type` is a list reference); predicates generated by clients that assume scalar fields where the model now has arrays.","commonSituations":"Model schema changes turning a scalar column into an array/JSON column; generic filter builders applying equality to every field; misunderstanding which operators apply to arrays.","solutions":["Replace the single-value comparison with an array operator (`_contains`, or the connector's array comparison)","If the field should be scalar, fix the model's field type from list to scalar","Filter on an element expression supported by your connector instead of the array itself"],"exampleFix":"// before\n{\"field\": \"tags\", \"operator\": \"_eq\", \"value\": \"hot\"}\n// after\n{\"field\": \"tags\", \"operator\": \"_contains\", \"value\": [\"hot\"]}\n","handlingStrategy":"type-guard","validationCode":"// Guard: never single-value-compare array fields\nif field_type.underlying_type().is_array() {\n    return Err(\"use an array operator for list fields\".into());\n}","typeGuard":"fn is_array_type(fr: &QualifiedTypeReference) -> bool {\n    matches!(fr.underlying_type(), UnderlyingType::List(_))\n}","tryCatchPattern":"if let Err(TypePredicateError::UnsupportedFieldComparisonToArrayType { field_name, .. }) = result {\n    // switch to _contains or another array operator\n}","preventionTips":["Build filter UIs that choose operators by field cardinality","Track which model fields are lists and avoid _eq on them"],"tags":["filter","array","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"}