{"record":{"id":"bea8c54aa73e2307","repo":"hasura/graphql-engine","slug":"cannot-find-type-custom-type-when-resolving-arg","errorCode":null,"errorMessage":"cannot find type {custom_type:} when resolving arguments for comparison operator {operator_name:} for {boolean_expression_type:}","messagePattern":"cannot find type (.+?) when resolving arguments for comparison operator (.+?) for (.+?)","errorType":"validation","errorClass":"ScalarBooleanExpressionTypeError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs","lineNumber":25,"sourceCode":"    data_connector::{DataConnectorName, DataConnectorScalarType},\n    types::{CustomTypeName, OperatorName},\n};\n\n#[derive(Debug, thiserror::Error)]\npub enum ScalarBooleanExpressionTypeError {\n    #[error(\n        \"unknown data connector {data_connector:} referenced in scalar type representation of {scalar_type:}\"\n    )]\n    ScalarTypeFromUnknownDataConnector {\n        data_connector: Qualified<DataConnectorName>,\n        scalar_type: DataConnectorScalarType,\n    },\n    #[error(\"cannot find scalar type {scalar_type:} in data connector {data_connector:}\")]\n    UnknownScalarTypeInDataConnector {\n        data_connector: Qualified<DataConnectorName>,\n        scalar_type: DataConnectorScalarType,\n    },\n    #[error(\n        \"cannot find type {custom_type:} when resolving arguments for comparison operator {operator_name:} for {boolean_expression_type:}\"\n    )]\n    UnknownCustomTypeInComparisonOperatorArgument {\n        custom_type: Qualified<CustomTypeName>,\n        operator_name: OperatorName,\n        boolean_expression_type: Qualified<CustomTypeName>,\n    },\n    #[error(\"data connector {data_connector:} could not be found\")]\n    DataConnectorNotFound {\n        data_connector: Qualified<DataConnectorName>,\n    },\n    #[error(\"scalar representations for data connector {data_connector:} could not be found\")]\n    DataConnectorScalarRepresentationsNotFound {\n        data_connector: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"scalar type representation required for type {scalar_type:} in data connector {data_connector:}\"\n    )]","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/scalar_boolean_expressions/error.rs#L7-L43","documentation":"A comparison operator on a boolean expression type declares an argument whose type is a custom type that cannot be found during resolution. The resolver needs the argument's type to build the operator's input schema; a missing Qualified<CustomTypeName> aborts the scalar boolean expressions stage.","triggerScenarios":"An operator in a boolean expression type configuration lists an argument referencing a custom type name that isn't defined in the types subgraph — typo, deleted type, or wrong namespace qualification.","commonSituations":"Renaming or removing a custom type still used as an operator argument; copy-pasting operator definitions between subgraphs with different type sets; namespace mismatch in the qualified type name.","solutions":["Grep metadata for the custom type name from the error and correct the spelling or namespace in the operator's argument definition","If the type was renamed, update the operator argument to the new name","If the type is missing entirely, add its definition or use a builtin scalar for the argument"],"exampleFix":"# before\noperators:\n  _eq:\n    argumentType: my_subgraph/Teimstamp   # type is 'my_subgraph/Timestamp'\n# after\noperators:\n  _eq:\n    argumentType: my_subgraph/Timestamp","handlingStrategy":"validation","validationCode":"fn check_operator_arg_types(\n    types: &BTreeSet<Qualified<CustomTypeName>>,\n    ops: &[(OperatorName, Qualified<CustomTypeName>)],\n) -> Result<(), String> {\n    for (op, ty) in ops {\n        if !types.contains(ty) { return Err(format!(\"operator {op} argument type {ty} undefined\")); }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"downcast UnknownCustomTypeInComparisonOperatorArgument and report operator name, missing type, and enclosing boolean expression type","preventionTips":["Grep for a custom type name before renaming/removing it","Keep operator definitions and the types they reference in the same subgraph"],"tags":["metadata","boolean-expressions","comparison-operators","unknown-type","hasura-ddn"],"backgroundTag":"undefined-type-reference","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}