{"record":{"id":"c58c8046864825ee","repo":"hasura/graphql-engine","slug":"field-field-name-of-type-type-name-used-in","errorCode":null,"errorMessage":"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","messagePattern":"field '(.+?)' of type '(.+?)' used in a field comparison has the unknown NDC 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":439,"sourceCode":"    #[error(\"boolean expression '{boolean_expression_name:}' not found\")]\n    BooleanExpressionNotFound {\n        boolean_expression_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"field '{field_name:}' could not be found in boolean expression type for object type '{type_name:}'\"\n    )]\n    BooleanExpressionFieldNotFound {\n        field_name: Spanned<FieldName>,\n        type_name: Qualified<CustomTypeName>,\n    },\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(","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/types/error.rs#L421-L457","documentation":"A field comparison (comparing a field to a single value, e.g. `_eq`/`_lt`) was attempted on a field whose underlying NDC type is unknown to the resolver. Because the resolver cannot prove the value can be encoded/compared in the connector's type system, it refuses the comparison.","triggerScenarios":"Comparing a field whose type maps to an NDC type name not present in the connector's schema/types; custom scalar with missing type mapping; comparing opaque or JSON-typed columns without declared comparability.","commonSituations":"Connector returning exotic column types (e.g. custom PG types, opaque types) with no explicit type mapping in metadata; adding new scalars without defining their NDC type mapping; connector version drift changing reported type names.","solutions":["Inspect `ndc_type_name` in the message and the field's `field_type` mapping in metadata","Add or fix the type mapping for the custom scalar so the NDC type name is known/comparable","Alternatively filter on a different field with a well-known scalar type","Check the connector's schema response to confirm the exact type name spelling"],"exampleFix":"# before: field with unknown NDC type used in _eq\nfilters: {field: custom_col, op: _eq, value: \"x\"}\n# after: declare the scalar's type mapping in metadata\ntypes:\n  CustomCol:\n    kind: scalar\n    representation: {type: string}\n","handlingStrategy":"type-guard","validationCode":"// Skip single-value comparisons for fields with unknown NDC types\nif !ndc_types.contains(&field.ndc_type_name) {\n    return Err(\"field's NDC type unknown; add a type mapping\".into());\n}","typeGuard":"fn is_comparable_scalar(f: &Field, known: &HashSet<TypeName>) -> bool {\n    known.contains(&f.ndc_type_name) && !f.type_ref.underlying_type().is_array()\n}","tryCatchPattern":"if let Err(TypePredicateError::UnsupportedFieldComparisonToUnknownType { field_name, ndc_type_name, .. }) = result {\n    // add a type mapping for ndc_type_name or filter another field\n}","preventionTips":["Map every custom scalar to an NDC type in metadata","Inspect connector schema output for exact type names"],"tags":["ndc","type-mapping","field-comparison","metadata","hasura"],"backgroundTag":"unsupported-type-in-filter","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}