{"record":{"id":"b7fce59636d36546","repo":"hasura/graphql-engine","slug":"validating-current-directory-failed-w","errorCode":null,"errorMessage":"validating current directory failed: %w","messagePattern":"validating current directory failed: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/cli.go","lineNumber":657,"sourceCode":"\tec.CodegenAssetsRepo = util.NewGitUtil(util.ActionsCodegenRepoURI, base, \"\")\n\n\tec.CodegenAssetsRepo.Logger = ec.Logger\n\tif ec.GlobalConfig.CLIEnvironment == ServerOnDockerEnvironment {\n\t\tec.CodegenAssetsRepo.DisableCloneOrUpdate = true\n\t}\n\n\treturn nil\n}\n\n// Validate prepares the ExecutionContext ec and then validates the\n// ExecutionDirectory to see if all the required files and directories are in\n// place.\nfunc (ec *ExecutionContext) Validate() error {\n\tvar op errors.Op = \"cli.ExecutionContext.Validate\"\n\t// validate execution directory\n\terr := ec.validateDirectory()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"validating current directory failed: %w\", err))\n\t}\n\n\t// load .env file\n\terr = ec.loadEnvfile()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"loading .env file failed: %w\", err))\n\t}\n\n\t// set names of config file\n\tec.ConfigFile = filepath.Join(ec.ExecutionDirectory, \"config.yaml\")\n\n\t// read config and parse the values into Config\n\terr = ec.readConfig()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"cannot read config: %w\", err))\n\t}\n\n\t// initialize HTTP client","sourceCodeStart":639,"sourceCodeEnd":675,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/cli.go#L639-L675","documentation":"The boolean expression builder could not find the requested comparison operator for the field's type. Data connectors advertise operators per operand type (e.g. _eq for strings, _gt for numbers); requesting one that isn't supported or isn't mapped for that field type raises this error.","triggerScenarios":"Using an operator like _gt on a string field where the connector only defines it for numbers; using a connector-specific operator name that doesn't exist; filtering a custom scalar type whose operators weren't registered in the connector's capabilities.","commonSituations":"Assuming all connectors support the standard SQL operator set; custom scalars (JSON, geometry) without operator definitions; connector capability changes after upgrades.","solutions":["Check the connector's operator mappings for the field's type and use a supported operator","Cast or re-type the field to a type that supports the operator","Add/register the missing operator in the data connector capabilities","Avoid that operator on custom scalar types, or expose it via a computed field/command instead"],"exampleFix":"# before\nwhere: { age: { _like: \"2%\" } } # _like not valid for Int\n# after\nwhere: { name: { _like: \"A%\" } }","handlingStrategy":"validation","validationCode":"// Whitelist operators per field type from connector capabilities\nconst allowed = caps.operators_for(fieldType);\nif (!allowed.includes(op)) throw new Error(`${op} unsupported on ${fieldType}`);","typeGuard":"const isOperatorSupported = (caps, op, typeName) => !!caps?.operators?.[op] && caps.operators[op].operand_type === typeName;","tryCatchPattern":"try { filter(); } catch (e) { if (e?.code === 'OperatorNotFoundForField') fallbackToSupportedOp(e.operator_name); else throw e; }","preventionTips":["Build operator UIs/APIs from connector capability metadata instead of assuming SQL semantics","Test filters against each connector type you support"],"tags":["operator","filtering","data-connector","boolean-expression"],"backgroundTag":"unsupported-comparison-operator","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}