{"record":{"id":"7df7679ca89975d8","repo":"hasura/graphql-engine","slug":"the-order-by-expression-order-by-expression-iden","errorCode":null,"errorMessage":"The order by expression '{order_by_expression_identifier}' used in model '{model_name}' contains a nested field '{nested_field_name}', however the data connector '{data_connector_name}' used in the model does not support ordering by nested fields","messagePattern":"The order by expression '(.+?)' used in model '(.+?)' contains a nested field '(.+?)', however the data connector '(.+?)' used in the model does not support ordering by nested fields","errorType":"validation","errorClass":"ModelsIssue","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/models/types.rs","lineNumber":124,"sourceCode":"        issue: ArgumentMappingIssue,\n    },\n    #[error(\n        \"The orderable field '{field_name}' in model '{model_name}' is not a scalar field (type: {field_type}) and therefore cannot be used for ordering. Upgrade to version 2 Models and use OrderByExpressions to order by nested fields\"\n    )]\n    ModelV1OrderableFieldIsNotAScalarField {\n        model_name: Qualified<ModelName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"The orderable field '{field_name}' in model '{model_name}' is an array type (type: {field_type}) and therefore cannot be used for ordering\"\n    )]\n    ModelV1OrderableFieldIsAnArrayType {\n        model_name: Qualified<ModelName>,\n        field_name: FieldName,\n        field_type: QualifiedTypeReference,\n    },\n    #[error(\n        \"The order by expression '{order_by_expression_identifier}' used in model '{model_name}' contains a nested field '{nested_field_name}', however the data connector '{data_connector_name}' used in the model does not support ordering by nested fields\"\n    )]\n    OrderByExpressionContainsUnsupportedNestedField {\n        order_by_expression_identifier: Qualified<OrderByExpressionIdentifier>,\n        model_name: Qualified<ModelName>,\n        nested_field_name: FieldName,\n        data_connector_name: Qualified<DataConnectorName>,\n    },\n    #[error(\n        \"Issue in order by expression '{order_by_expression_identifier}' used by model '{model_name}': {error}\"\n    )]\n    OrderableRelationshipError {\n        order_by_expression_identifier: Qualified<OrderByExpressionIdentifier>,\n        model_name: Qualified<ModelName>,\n        error: order_by_expressions::OrderableRelationshipError,\n    },\n    #[error(\n        \"The target model '{target_model_name}' of the orderable relationship '{relationship_name}' in order by expression '{order_by_expression_identifier}' used in model '{model_name}' must have a source\"","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/models/types.rs#L106-L142","documentation":"An order_by expression in a v2 model traverses a nested field, but the data connector backing the model does not support ordering by nested fields (missing the ordering_by_nested_fields capability).","triggerScenarios":"Defining an order_by_expression whose path goes through a nested object/array while using a connector that lacks nested-field ordering support.","commonSituations":"Using connectors like simple REST/Lambda connectors or older agent versions for models with nested order-by expressions.","solutions":["Remove the nested field from the order_by_expression","Switch to a connector that supports ordering by nested fields","Flatten the nested data into scalar columns in the underlying data source"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check the connector capability before defining nested order_by expressions\nassert!(connector.capabilities.ordering_by_nested_fields, \"connector cannot order by nested fields\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read connector capability docs before writing nested order_by_expressions","Flatten nested data when using limited connectors"],"tags":["hasura","models","order-by-expressions","data-connector","capability"],"backgroundTag":"connector-capability-unsupported","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}