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

  1. Treat this as the inner CommandsError — read the wrapped message to identify the actual command problem
  2. Fix the command metadata (types, names, arguments) that the inner error points to
  3. 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

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


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/a0fdd2d5a8d91ec3. Report an issue: GitHub.