hasura/graphql-engine · error · OrderableRelationshipError

The orderable relationship '{relationship_name}' defined for

Error message

The orderable relationship '{relationship_name}' defined for '{orderable_type}' is not supported in ordering because the data connector '{data_connector_name}' does not support nested relationships

What it means

Thrown when an orderable relationship is a nested relationship (a relationship traversed through another relationship) and the involved data connector does not support nested relationships in ordering. Even connectors that support flat relationships may not support nesting them inside ORDER BY.

Source

Thrown at v3/crates/metadata-resolve/src/stages/order_by_expressions/error.rs:90

#[derive(Debug, thiserror::Error)]
#[allow(clippy::enum_variant_names)]
pub enum OrderableRelationshipError {
    #[error(
        "The orderable relationship '{relationship_name}' defined for '{orderable_type}' is a remote relationship and remote relationships are not supported in ordering"
    )]
    RemoteRelationshipsNotSupported {
        orderable_type: Qualified<CustomTypeName>,
        relationship_name: RelationshipName,
    },
    #[error(
        "The orderable relationship '{relationship_name}' defined for '{orderable_type}' is not supported in ordering because the data connector '{data_connector_name}' does not support relationships"
    )]
    RelationshipsNotSupported {
        orderable_type: Qualified<CustomTypeName>,
        relationship_name: RelationshipName,
        data_connector_name: Qualified<open_dds::data_connector::DataConnectorName>,
    },
    #[error(
        "The orderable relationship '{relationship_name}' defined for '{orderable_type}' is not supported in ordering because the data connector '{data_connector_name}' does not support nested relationships in ordering"
    )]
    NestedRelationshipsNotSupported {
        orderable_type: Qualified<CustomTypeName>,
        relationship_name: RelationshipName,
        data_connector_name: Qualified<open_dds::data_connector::DataConnectorName>,
    },
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Flatten the orderable relationship so it references a directly related type instead of nesting
  2. Verify the connector's capabilities include nested relationships in ordering; if you own the connector, implement/declare it
  3. Otherwise remove the nested relationship from ordering metadata
Defensive patterns

Strategy: validation

Validate before calling

// Reject orderable relationship paths longer than one hop unless connector supports nesting
if (path.length > 1 && !capabilities.nested_order_by) skip(path);

Type guard

const supportsNestedOrdering = (caps) => Boolean(caps?.relationships?.nested ?? caps?.nested_order_by);

Prevention

When it happens

Trigger: Declaring an orderable relationship path that traverses more than one relationship (nested), where any data connector in the chain does not support nested relationships in ordering, during metadata resolution of order_by_expressions.

Common situations: Adding deep ordering paths like nestedObject.nestedField to orderable relationships against a connector (e.g. a simple REST or single-table connector) that only supports direct relationships; upgrading a connector whose nested-ordering support was removed or not yet released.

Related errors


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