hasura/graphql-engine · error
cannot get absolute path: %w
Error message
cannot get absolute path: %w
What it means
Thrown when a type used in a boolean expression/filter has no type mapping in the target data connector. Type mappings tell NDC how a GraphQL/custom type maps to the connector's native type; without one the connector cannot evaluate predicates on that type.
Source
Thrown at cli/cli.go:576
ec.ID = uuid.NewString()
ec.Logger.Debugf("execution id: %v", ec.ID)
}
ec.Telemetry.ExecutionID = ec.ID
return nil
}
// SetupPlugins create and returns the inferred paths for hasura. By default, it assumes
// $HOME/.hasura as the base path.
func (ec *ExecutionContext) SetupPlugins() error {
var op errors.Op = "cli.ExecutionContext.SetupPlugins"
base := filepath.Join(ec.GlobalConfigDir, "plugins")
base, err := filepath.Abs(base)
if err != nil {
return errors.E(op, fmt.Errorf("cannot get absolute path: %w", err))
}
ec.PluginsConfig = plugins.New(base)
ec.PluginsConfig.Logger = ec.Logger
ec.PluginsConfig.Repo.Logger = ec.Logger
if ec.GlobalConfig.CLIEnvironment == ServerOnDockerEnvironment {
ec.PluginsConfig.Repo.DisableCloneOrUpdate = true
}
err = ec.PluginsConfig.Prepare()
if err != nil {
return errors.E(op, err)
}
return nil
}
View on GitHub (pinned to 724551b9ae)
Solutions
- Add a type mapping for the named type in the data connector configuration
- Use a supported underlying type or cast the field to a mapped type in the model definition
- If it's a comparison type, register it in the connector's comparison_types/type mappings
- Verify the type name matches exactly (spelling, casing) between metadata and connector config
Example fix
// before: model field typed 'Money' with no mapping
// after: add to data connector type_mappings
money: { source_type: 'Money', type: 'string' } Defensive patterns
Strategy: validation
Validate before calling
// Verify each filterable field's type has a connector type mapping
for (const f of model.fields) {
if (filterable(f) && !connectorTypeMappings[f.type.name]) {
throw new Error(`No type mapping for ${f.type.name}`);
}
} Type guard
const isMappedType = (mappings, typeName) => mappings[typeName] !== undefined;
Try / catch
try { resolve(); } catch (e) { if (e?.code === 'UnknownTypeMapping') addTypeMapping(e.type_name, e.data_connector_name); else throw e; } Prevention
- Maintain type mappings alongside model definitions in code review
- Add CI checks that all custom types used in filters have mappings
When it happens
Trigger: Filtering on a model field whose type has no entry in the data connector's type_mappings; adding a command returning a custom type that the connector doesn't support; using a scalar format (e.g. a specific datetime format) not declared in the connector's type mappings.
Common situations: Custom object/comparison types not added to the connector's type mapping config; switching connector versions that dropped support for a type; formatting UUID/bigint/datetime as a type the connector can't map.
Related errors
- setting up global config failed: %w
- validating current directory failed: %w
- loading .env file failed: %w
- the aggregate expression {name} defines an aggregation funct
- the aggregate expression {name} defines an aggregation funct
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/a12695a806f9256c.
Report an issue: GitHub.