{"record":{"id":"db528f7ec29a406f","repo":"hasura/graphql-engine","slug":"field-field-name-of-type-type-name-is-an","errorCode":null,"errorMessage":"field '{field_name:}' of type '{type_name:}' is an array type and cannot be used in a nested field predicate","messagePattern":"field '(.+?)' of type '(.+?)' is an array type and cannot be used in a nested field predicate","errorType":"validation","errorClass":"TypePredicateError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":406,"sourceCode":"    UnknownFieldInTypePredicate {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"field '{field_name:}' used in predicate for type '{type_name:}' could not be found in boolean expression {boolean_expression_type}\"\n    )]\n    TypePredicateFieldNotFoundInBooleanExpression {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n\n    #[error(\"field '{field_name:}' could not be found in field mappings for type '{type_name:}'\")]\n    UnknownFieldInFieldMappings {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"field '{field_name:}' of type '{type_name:}' is an array type and cannot be used in a nested field predicate\"\n    )]\n    ArrayFieldInNestedFieldPredicate {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"unknown field '{field_name}' for type '{type_name}' used in target mapping for relationship '{relationship_name}'\"\n    )]\n    UnknownFieldInModelRelationshipTargetMapping {\n        field_name: FieldName,\n        type_name: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n    },\n    #[error(\"boolean expression '{boolean_expression_name:}' not found\")]\n    BooleanExpressionNotFound {\n        boolean_expression_name: Qualified<CustomTypeName>,\n    },","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L388-L424","documentation":"A nested field predicate tried to descend into a field that is an array (list) type. Nested predicates only traverse into object/structured fields; array-typed fields require dedicated array operators (like `_contains`) and cannot be navigated as if they were nested objects.","triggerScenarios":"Building a filter like `{field: {path: {to: {array_field: {nested: ...}}}}}` where `array_field` is a list type; writing `relationship.field` style nested predicates through a list column.","commonSituations":"Treating a JSON/array column as a nested object in filters; assuming nested predicates work through array relationships; model changes turning an object field into a list field.","solutions":["Stop descending into `field_name` and instead apply an array operator directly to it (e.g. `_contains`, `_any`/`_all` style operators your connector supports)","If the field should be scalar-navigable, change its type from a list to a single object in the model","Filter the scalar fields of the array elements via the connector's array-comparison operators rather than nested paths"],"exampleFix":"// before\n{\"field\": \"tags\", \"operator\": \"_nested\", \"value\": {\"field\": \"name\", \"operator\": \"_eq\", \"value\": \"hot\"}}\n// after\n{\"field\": \"tags\", \"operator\": \"_contains\", \"value\": {\"name\": \"hot\"}}\n","handlingStrategy":"type-guard","validationCode":"// Reject nested descent into array-typed fields before building the predicate\nif field_type.underlying_type().is_array() {\n    return Err(\"cannot nest into array field; use an array operator\".into());\n}","typeGuard":"fn is_array_field(fr: &QualifiedTypeReference) -> bool {\n    matches!(fr.underlying_type(), UnderlyingType::List(_))\n}","tryCatchPattern":"if let Err(TypePredicateError::ArrayFieldInNestedFieldPredicate { field_name, .. }) = result {\n    // rewrite as an array-operator predicate\n}","preventionTips":["Check a field's cardinality before writing nested predicates","Prefer array operators (_contains etc.) for list fields"],"tags":["metadata","predicate","array","nested-filter","hasura"],"backgroundTag":"invalid-filter-operator","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}