{"record":{"id":"e43bfef600e1c722","repo":"hasura/graphql-engine","slug":"field-field-name-could-not-be-found-in-field","errorCode":null,"errorMessage":"field '{field_name:}' could not be found in field mappings for type '{type_name:}'","messagePattern":"field '(.+?)' could not be found in field mappings for type '(.+?)'","errorType":"validation","errorClass":"TypePredicateError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/types/error.rs","lineNumber":401,"sourceCode":"}\n\n#[derive(Debug, thiserror::Error)]\npub enum TypePredicateError {\n    #[error(\"unknown field '{field_name:}' used in predicate for type '{type_name:}'\")]\n    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,","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L383-L419","documentation":"The metadata resolver could not find the named field in the field mappings of the given type while resolving a predicate. Field mappings connect logical field names to underlying data-source representations; a predicate field missing from these mappings cannot be translated into a data request.","triggerScenarios":"A predicate or mapping-dependent resolution step looks up a field name in `type_name`'s field mappings and it is absent — e.g. after mappings were pruned, renamed, or the field is purely virtual/computed with no mapping.","commonSituations":"Renaming mapped field names in metadata without updating predicates; fields added to predicates but never mapped to a column; connector-specific mappings missing after a connector update.","solutions":["Inspect the field mappings for `type_name` in your metadata and confirm which field names are mapped","Add or restore a mapping entry for `field_name`, or correct the predicate to use a mapped field","If the field is computed/derived, ensure its mapping kind (e.g. column vs computed) is properly defined"],"exampleFix":"# before: predicate uses unmapped field\nfilters: {field: display_name, op: _eq, value: \"x\"}\n# after: map it or filter a mapped field\nfields:\n  display_name:\n    type: string\n    mapping: {column: display_name}\nfilters: {field: display_name, op: _eq, value: \"x\"}\n","handlingStrategy":"validation","validationCode":"// Check field mappings before resolving predicates\nif !type_mappings.contains_key(&field_name) {\n    return Err(format!(\"field {field_name} missing from mappings of {type_name}\"));\n}","typeGuard":"fn is_mapped(mappings: &BTreeMap<FieldName, FieldMapping>, f: &FieldName) -> bool {\n    mappings.contains_key(f)\n}","tryCatchPattern":"if let Err(TypePredicateError::UnknownFieldInFieldMappings { field_name, type_name }) = result {\n    return Err(format!(\"{field_name} not mapped on {type_name}\"));\n}","preventionTips":["Define mappings whenever adding filterable fields","Validate metadata end-to-end after renaming mapped fields"],"tags":["metadata","field-mapping","predicate","hasura","ndc"],"backgroundTag":"unknown-field-in-filter","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}