hasura/graphql-engine · error
validating current directory failed: %w
Error message
validating current directory failed: %w
What it means
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.
Source
Thrown at cli/cli.go:657
ec.CodegenAssetsRepo = util.NewGitUtil(util.ActionsCodegenRepoURI, base, "")
ec.CodegenAssetsRepo.Logger = ec.Logger
if ec.GlobalConfig.CLIEnvironment == ServerOnDockerEnvironment {
ec.CodegenAssetsRepo.DisableCloneOrUpdate = true
}
return nil
}
// Validate prepares the ExecutionContext ec and then validates the
// ExecutionDirectory to see if all the required files and directories are in
// place.
func (ec *ExecutionContext) Validate() error {
var op errors.Op = "cli.ExecutionContext.Validate"
// validate execution directory
err := ec.validateDirectory()
if err != nil {
return errors.E(op, fmt.Errorf("validating current directory failed: %w", err))
}
// load .env file
err = ec.loadEnvfile()
if err != nil {
return errors.E(op, fmt.Errorf("loading .env file failed: %w", err))
}
// set names of config file
ec.ConfigFile = filepath.Join(ec.ExecutionDirectory, "config.yaml")
// read config and parse the values into Config
err = ec.readConfig()
if err != nil {
return errors.E(op, fmt.Errorf("cannot read config: %w", err))
}
// initialize HTTP clientView on GitHub (pinned to 724551b9ae)
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
Example fix
# before
where: { age: { _like: "2%" } } # _like not valid for Int
# after
where: { name: { _like: "A%" } } Defensive patterns
Strategy: validation
Validate before calling
// Whitelist operators per field type from connector capabilities
const allowed = caps.operators_for(fieldType);
if (!allowed.includes(op)) throw new Error(`${op} unsupported on ${fieldType}`); Type guard
const isOperatorSupported = (caps, op, typeName) => !!caps?.operators?.[op] && caps.operators[op].operand_type === typeName;
Try / catch
try { filter(); } catch (e) { if (e?.code === 'OperatorNotFoundForField') fallbackToSupportedOp(e.operator_name); else throw e; } Prevention
- Build operator UIs/APIs from connector capability metadata instead of assuming SQL semantics
- Test filters against each connector type you support
When it happens
Trigger: 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.
Common situations: Assuming all connectors support the standard SQL operator set; custom scalars (JSON, geometry) without operator definitions; connector capability changes after upgrades.
Related errors
- setting up global config failed: %w
- cannot get absolute path: %w
- loading .env file failed: %w
- version check: %w
- Scalar representations for data connector '{data_connector_n
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/b7fce59636d36546.
Report an issue: GitHub.