hasura/graphql-engine · error · OrderByExpressionError
{message}
Error message
{message} What it means
Thrown by the metadata-resolve crate when an order-by expression uses a feature that is not supported by the current metadata/configuration. It is a generic 'UnsupportedFeature' variant in the OrderByExpressionsError enum carrying a free-form message produced during resolution of order_by_expressions metadata.
Source
Thrown at v3/crates/metadata-resolve/src/stages/order_by_expressions/error.rs:68
#[error(
"The order by expression {order_by_expression_name} referenced in orderable relationship {relationship_name} has not been defined"
)]
UnknownOrderByExpressionNameInOrderableRelationship {
order_by_expression_name: OrderByExpressionName,
relationship_name: RelationshipName,
},
#[error(
"The type of the order by expression {order_by_expression_name} referenced in field {field_name} does not match the field type. Order by expression type: {order_by_expression_type}; field type: {field_type}. "
)]
OrderableFieldTypeError {
order_by_expression_name: OrderByExpressionName,
order_by_expression_type: TypeName,
field_type: QualifiedBaseType,
field_name: FieldName,
},
#[error("{0}")]
GraphqlConfigError(#[from] graphql_config::GraphqlConfigError),
#[error("{message}")]
UnsupportedFeature { message: String },
}
#[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>,View on GitHub (pinned to 724551b9ae)
Solutions
- Read the embedded {message} — it states exactly which feature is unsupported
- Check the order_by_expressions section of your OpenDD metadata for the offending expression and simplify it (order only on scalar fields without arguments)
- Verify the expression type and field types are supported types in your metadata
- Upgrade the hasura metadata-resolve v3 crates to a version that supports the feature mentioned in the message
Defensive patterns
Strategy: validation
Validate before calling
// Before applying metadata, lint order_by_expressions entries against supported features
for (const expr of metadata.order_by_expressions ?? []) {
assertScalarFieldsOnly(expr, supportedTypes);
} Prevention
- Keep metadata tooling/crates and connector versions in sync
- Run metadata resolve/validate in CI before applying changes
When it happens
Trigger: Declaring an order_by_expressions entry in OpenDD metadata whose expression type or field usage relies on a capability the resolver does not support (e.g. exotic type names or field types the order-by pipeline cannot map); triggered while resolving the order_by_expressions metadata stage.
Common situations: Upgrading NDC v3 metadata where new order-by expression syntax is used but the resolver version does not support it; hand-written OpenDD YAML with order-by expressions referencing unsupported scalar/command types.
Related errors
- The orderable relationship '{relationship_name}' defined for
- Duplicate order by expression found: {order_by_expression}
- Cannot order by array relationship {relationship_name} in or
- The orderable field "{field_name}" has field arguments and c
- error building metadata
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/e14b1dfb02360787.
Report an issue: GitHub.