{"record":{"id":"51995a46be4fbb38","repo":"hasura/graphql-engine","slug":"the-orderable-relationship-relationship-name-d","errorCode":null,"errorMessage":"The orderable relationship '{relationship_name}' defined for '{orderable_type}' is a remote relationship and remote relationships are not supported in ordering","messagePattern":"The orderable relationship '(.+?)' defined for '(.+?)' is a remote relationship and remote relationships are not supported in ordering","errorType":"validation","errorClass":"OrderableRelationshipError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/order_by_expressions/error.rs","lineNumber":75,"sourceCode":"    #[error(\n        \"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}. \"\n    )]\n    OrderableFieldTypeError {\n        order_by_expression_name: OrderByExpressionName,\n        order_by_expression_type: TypeName,\n        field_type: QualifiedBaseType,\n        field_name: FieldName,\n    },\n    #[error(\"{0}\")]\n    GraphqlConfigError(#[from] graphql_config::GraphqlConfigError),\n    #[error(\"{message}\")]\n    UnsupportedFeature { message: String },\n}\n\n#[derive(Debug, thiserror::Error)]\n#[allow(clippy::enum_variant_names)]\npub enum OrderableRelationshipError {\n    #[error(\n        \"The orderable relationship '{relationship_name}' defined for '{orderable_type}' is a remote relationship and remote relationships are not supported in ordering\"\n    )]\n    RemoteRelationshipsNotSupported {\n        orderable_type: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n    },\n    #[error(\n        \"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\"\n    )]\n    RelationshipsNotSupported {\n        orderable_type: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n        data_connector_name: Qualified<open_dds::data_connector::DataConnectorName>,\n    },\n    #[error(\n        \"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\"\n    )]\n    NestedRelationshipsNotSupported {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/order_by_expressions/error.rs#L57-L93","documentation":"Thrown when an orderable relationship defined for a type is a remote relationship. Remote relationships span different data sources and cannot be evaluated inside ORDER BY clauses, so metadata resolution rejects them.","triggerScenarios":"Adding a relationship to a type's orderable_relationships (or order_by_expressions using it) where the relationship targets a remote schema/data connector instead of a local data connector relationship.","commonSituations":"Copy-pasting an orderable relationship configuration onto a type that also has remote relationships; migrating a relationship from local to remote while leaving it listed as orderable.","solutions":["Find the orderable relationship named in the error on the given type in your OpenDD metadata","If it is a remote relationship, remove it from the ordering configuration (orderable relationships / order_by_expressions)","Replace it with an equivalent local (same data connector) relationship if ordering is required"],"exampleFix":"// before (OpenDD yaml)\norderable_relationships:\n  - relationship_name: remoteAuthors\n// after: remove the remote relationship, keep only local ones\norderable_relationships:\n  - relationship_name: localAuthors","handlingStrategy":"validation","validationCode":"for (const rel of orderableRelationships) {\n  const def = relationships[rel.relationship_name];\n  if (def?.target_source?.type !== 'localDataConnector') {\n    throw new Error(`${rel.relationship_name} is remote and cannot be orderable`);\n  }\n}","typeGuard":"const isLocalRelationship = (r) => r.target_source?.data_connector_name !== undefined;","tryCatchPattern":null,"preventionTips":["Only mark local (same data connector) relationships as orderable","Review ordering metadata after converting relationships to remote"],"tags":["metadata","order-by","remote-relationships","open-dds","validation"],"backgroundTag":"unsupported-relationship-in-order-by","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}