{"record":{"id":"c66c4886d52944cd","repo":"hasura/graphql-engine","slug":"makegetorderbyelementvalue-only-table-relationshi","errorCode":null,"errorMessage":"makeGetOrderByElementValue: Only table relationships currently supported","messagePattern":"makeGetOrderByElementValue: Only table relationships currently supported","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"dc-agents/reference/src/query.ts","lineNumber":545,"sourceCode":"      };\n      const subquery = addRelationshipFilterToQuery(row, relationship, query);\n\n      if (subquery === null) {\n        return null;\n      } else {\n        const relationshipTarget = relationship.target;\n        switch (relationshipTarget.type) {\n          case 'table':\n            const queryResponse = performQuery(\n              { type: 'table', table: relationshipTarget.name },\n              subquery,\n            );\n            return extractResultFromOrderByElementQueryResponse(\n              innerOrderByElement,\n              queryResponse,\n            );\n          default:\n            throw new Error(\n              'makeGetOrderByElementValue: Only table relationships currently supported',\n            );\n        }\n      }\n    }\n  };\n\nconst sortRows = (\n  rows: Record<string, RawScalarValue>[],\n  orderBy: OrderBy,\n  getOrderByElementValue: (\n    orderByElement: OrderByElement,\n    row: Record<string, RawScalarValue>,\n    orderByRelations: Record<RelationshipName, OrderByRelation>,\n  ) => RawScalarValue,\n): Record<string, RawScalarValue>[] =>\n  rows\n    .map<[Record<string, RawScalarValue>, RawScalarValue[]]>((row) => [row, []])","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/dc-agents/reference/src/query.ts#L527-L563","documentation":"While resolving an order-by element across relationships, the engine looks up the relationship for the first path segment and dispatches on the relationship target's type. Only table targets are implemented; any other target type falls through to this error.","triggerScenarios":"An order_by with a non-empty target_path whose first segment names a relationship whose target type is not 'table' in the schema.","commonSituations":"Custom connector backends emitting non-table relationship targets; schema metadata drift or malformed relationship definitions; hand-crafted schemas with unsupported target types.","solutions":["Check the schema's relationships for the segment named in target_path and confirm each target is { type: 'table', name: ... }.","Flatten the order-by to use only table-target relationships, or sort on a column of the current table.","Fix the backend/metadata producing non-table relationship targets."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const rel = relationships[orderBy.target_path[0]];\nif (rel && rel.target.type !== 'table') throw new Error('order_by path requires table relationship');","typeGuard":"const isTableRelationship = (r: Relationship | undefined): r is { target: { type: 'table'; name: string } } =>\n  r?.target.type === 'table';","tryCatchPattern":null,"preventionTips":["Check relationship target types in the schema before using them in order_by paths","Keep schemas limited to table targets for this reference agent"],"tags":["hasura","data-connector","order-by","unsupported-feature"],"backgroundTag":"unsupported-relationship-type","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}