hasura/graphql-engine · error · RelationshipError
{0}
Error message
{0} What it means
A transparent wrapper (#[from] conversion) around an error from the commands resolution stage (CommandsError). The relationship resolver delegates to command metadata resolution and any failure there is surfaced unchanged via this variant.
Source
Thrown at v3/crates/metadata-resolve/src/stages/object_relationships/error.rs:174
ValueExpressionMappingsNotSupportedYet,
#[error(
"The field path provided in the {location:} of the relationship {relationship_name} on type {type_name} is empty"
)]
EmptyFieldPath {
location: String,
relationship_name: RelationshipName,
type_name: Qualified<CustomTypeName>,
},
#[error(
"Model fields cannot be used in command based relationship: {relationship_name:} on type {type_name:}"
)]
ModelFieldCannotBeUsedInCommandRelationship {
relationship_name: RelationshipName,
type_name: Qualified<CustomTypeName>,
},
#[error("Relationships with nested field paths are not supported yet.")]
NestedFieldPathsNotSupportedYet,
#[error("{0}")]
CommandError(#[from] commands::CommandsError),
#[error("{0}")]
ModelError(#[from] models::ModelsError),
#[error("{0}")]
GraphqlError(#[from] graphql_config::GraphqlConfigError),
}
View on GitHub (pinned to 724551b9ae)
Solutions
- Treat this as the inner CommandsError — read the wrapped message to identify the actual command problem
- Fix the command metadata (types, names, arguments) that the inner error points to
- Re-run resolution; the relationship error disappears once the command resolves cleanly
Defensive patterns
Strategy: try-catch
Try / catch
try { await applyMetadata(md); } catch (e) { if (String(e).includes('relationship') && /command/i.test(e.cause?.message ?? '')) { /* handle underlying CommandsError from e.cause */ } throw e; } Prevention
- Resolve command metadata independently first so inner errors are caught earlier
- Keep command and relationship changes in the same change set and test together
When it happens
Trigger: Any error while resolving command metadata referenced by a relationship — unknown types in command arguments/output, invalid command names, or other command-level validation failures.
Common situations: Command metadata problems that only surface when a relationship pulls that command into resolution; editing commands and relationships together where the command part is broken.
Related errors
- unknown target command {command_name:} used in relationship
- target argument {argument_name} in argument mapping for rela
- The target argument {argument_name} of command {command_name
- No mapping for target command argument {argument_name} in th
- Model fields cannot be used in command based relationship: {
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/a0fdd2d5a8d91ec3.
Report an issue: GitHub.