@nicia-ai/typegraph 0.16.2 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/postgres/index.cjs +27 -27
- package/dist/backend/postgres/index.js +2 -2
- package/dist/backend/sqlite/index.cjs +12 -12
- package/dist/backend/sqlite/index.js +2 -2
- package/dist/backend/sqlite/libsql.cjs +28 -0
- package/dist/backend/sqlite/libsql.cjs.map +1 -0
- package/dist/backend/sqlite/libsql.d.cts +86 -0
- package/dist/backend/sqlite/libsql.d.ts +86 -0
- package/dist/backend/sqlite/libsql.js +26 -0
- package/dist/backend/sqlite/libsql.js.map +1 -0
- package/dist/backend/sqlite/local.cjs +7 -12
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.js +4 -9
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-5H74QKKF.cjs → chunk-HXJXTOXR.cjs} +23 -27
- package/dist/chunk-HXJXTOXR.cjs.map +1 -0
- package/dist/{chunk-2UTJRP4F.cjs → chunk-IYWWXOVK.cjs} +40 -28
- package/dist/chunk-IYWWXOVK.cjs.map +1 -0
- package/dist/{chunk-IRS2C6GN.js → chunk-LLHFS53Q.js} +10 -14
- package/dist/chunk-LLHFS53Q.js.map +1 -0
- package/dist/{chunk-7ZVPFJLQ.js → chunk-QFZQGEQ3.js} +40 -29
- package/dist/chunk-QFZQGEQ3.js.map +1 -0
- package/dist/index.cjs +63 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +63 -24
- package/dist/index.js.map +1 -1
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/{store-BZ7BexR1.d.cts → store-B_JzzHwb.d.cts} +2 -2
- package/dist/{store--7Nft1Ii.d.ts → store-DkY1pDfu.d.ts} +2 -2
- package/package.json +16 -1
- package/dist/chunk-2UTJRP4F.cjs.map +0 -1
- package/dist/chunk-5H74QKKF.cjs.map +0 -1
- package/dist/chunk-7ZVPFJLQ.js.map +0 -1
- package/dist/chunk-IRS2C6GN.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import { N as NodeType, E as EdgeType } from './types-DMzKq0d5.cjs';
|
|
|
3
3
|
export { A as AnyEdgeType, C as Cardinality, a as Collation, D as DeleteBehavior, b as EdgeId, c as EdgeProps, d as EdgeRegistration, e as EdgeTypeWithEndpoints, f as EndpointExistence, G as GraphDefaults, g as NodeId, h as NodeProps, i as NodeRegistration, S as SqlDialect, T as TemporalMode, U as UniqueConstraint, j as UniquenessScope, k as isEdgeType, l as isEdgeTypeWithEndpoints, m as isNodeType } from './types-DMzKq0d5.cjs';
|
|
4
4
|
import { I as InferenceType, M as MetaEdge, O as OntologyRelation } from './types-B3mmOMJV.cjs';
|
|
5
5
|
export { D as DEFAULT_SQL_SCHEMA, G as GraphBackend, a as MetaEdgeProperties, S as SqlSchema, b as SqlTableNames, T as TransactionBackend, c as createSqlSchema, i as isMetaEdge } from './types-B3mmOMJV.cjs';
|
|
6
|
-
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-
|
|
7
|
-
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store-
|
|
6
|
+
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-B_JzzHwb.cjs';
|
|
7
|
+
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store-B_JzzHwb.cjs';
|
|
8
8
|
import { G as GraphDef, K as KindRegistry } from './manager-Bj1UEnhE.cjs';
|
|
9
9
|
export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, S as SchemaManagerOptions, d as SchemaValidationResult, e as defineGraph, g as getEdgeKinds, f as getNodeKinds, i as isGraphDef } from './manager-Bj1UEnhE.cjs';
|
|
10
10
|
export { B as BackendDisposedError, C as CardinalityError, a as CompilerInvariantError, b as ConfigurationError, D as DatabaseOperationError, c as DisjointError, E as EdgeNotFoundError, d as EndpointError, e as EndpointNotFoundError, f as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, g as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaMismatchError, T as TypeGraphError, h as TypeGraphErrorOptions, U as UniquenessError, i as UnsupportedPredicateError, V as ValidationError, j as ValidationErrorDetails, k as ValidationIssue, l as VersionConflictError, m as getErrorSuggestion, n as isConstraintError, o as isSystemError, p as isTypeGraphError, q as isUserRecoverable } from './index-DXkEXpNz.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { N as NodeType, E as EdgeType } from './types-DMzKq0d5.js';
|
|
|
3
3
|
export { A as AnyEdgeType, C as Cardinality, a as Collation, D as DeleteBehavior, b as EdgeId, c as EdgeProps, d as EdgeRegistration, e as EdgeTypeWithEndpoints, f as EndpointExistence, G as GraphDefaults, g as NodeId, h as NodeProps, i as NodeRegistration, S as SqlDialect, T as TemporalMode, U as UniqueConstraint, j as UniquenessScope, k as isEdgeType, l as isEdgeTypeWithEndpoints, m as isNodeType } from './types-DMzKq0d5.js';
|
|
4
4
|
import { I as InferenceType, M as MetaEdge, O as OntologyRelation } from './types-ThB4cFLp.js';
|
|
5
5
|
export { D as DEFAULT_SQL_SCHEMA, G as GraphBackend, a as MetaEdgeProperties, S as SqlSchema, b as SqlTableNames, T as TransactionBackend, c as createSqlSchema, i as isMetaEdge } from './types-ThB4cFLp.js';
|
|
6
|
-
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store
|
|
7
|
-
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store
|
|
6
|
+
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-DkY1pDfu.js';
|
|
7
|
+
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store-DkY1pDfu.js';
|
|
8
8
|
import { G as GraphDef, K as KindRegistry } from './manager-Chhrq1vl.js';
|
|
9
9
|
export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, S as SchemaManagerOptions, d as SchemaValidationResult, e as defineGraph, g as getEdgeKinds, f as getNodeKinds, i as isGraphDef } from './manager-Chhrq1vl.js';
|
|
10
10
|
export { B as BackendDisposedError, C as CardinalityError, a as CompilerInvariantError, b as ConfigurationError, D as DatabaseOperationError, c as DisjointError, E as EdgeNotFoundError, d as EndpointError, e as EndpointNotFoundError, f as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, g as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaMismatchError, T as TypeGraphError, h as TypeGraphErrorOptions, U as UniquenessError, i as UnsupportedPredicateError, V as ValidationError, j as ValidationErrorDetails, k as ValidationIssue, l as VersionConflictError, m as getErrorSuggestion, n as isConstraintError, o as isSystemError, p as isTypeGraphError, q as isUserRecoverable } from './index-DXkEXpNz.js';
|
package/dist/index.js
CHANGED
|
@@ -2187,14 +2187,18 @@ function buildStandardProjection(input) {
|
|
|
2187
2187
|
});
|
|
2188
2188
|
return sql.join(projectedFields, sql`, `);
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2191
|
-
const
|
|
2190
|
+
function buildAliasToCteMap(ast) {
|
|
2191
|
+
const map = /* @__PURE__ */ new Map([
|
|
2192
2192
|
[ast.start.alias, `cte_${ast.start.alias}`]
|
|
2193
2193
|
]);
|
|
2194
2194
|
for (const traversal of ast.traversals) {
|
|
2195
|
-
|
|
2196
|
-
|
|
2195
|
+
map.set(traversal.nodeAlias, `cte_${traversal.nodeAlias}`);
|
|
2196
|
+
map.set(traversal.edgeAlias, `cte_${traversal.nodeAlias}`);
|
|
2197
2197
|
}
|
|
2198
|
+
return map;
|
|
2199
|
+
}
|
|
2200
|
+
function compileSelectiveProjection(fields, dialect, ast, collapsedTraversalCteAlias) {
|
|
2201
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2198
2202
|
const columns = fields.map((field2) => {
|
|
2199
2203
|
const cteAlias = collapsedTraversalCteAlias ?? aliasToCte.get(field2.alias) ?? `cte_${field2.alias}`;
|
|
2200
2204
|
if (field2.isSystemField) {
|
|
@@ -2243,6 +2247,7 @@ function buildStandardOrderBy(input) {
|
|
|
2243
2247
|
if (!ast.orderBy || ast.orderBy.length === 0) {
|
|
2244
2248
|
return void 0;
|
|
2245
2249
|
}
|
|
2250
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2246
2251
|
const parts = [];
|
|
2247
2252
|
for (const orderSpec of ast.orderBy) {
|
|
2248
2253
|
const valueType = orderSpec.field.valueType;
|
|
@@ -2251,7 +2256,7 @@ function buildStandardOrderBy(input) {
|
|
|
2251
2256
|
"Ordering by JSON arrays or objects is not supported"
|
|
2252
2257
|
);
|
|
2253
2258
|
}
|
|
2254
|
-
const cteAlias = collapsedTraversalCteAlias ?? `cte_${orderSpec.field.alias}`;
|
|
2259
|
+
const cteAlias = collapsedTraversalCteAlias ?? aliasToCte.get(orderSpec.field.alias) ?? `cte_${orderSpec.field.alias}`;
|
|
2255
2260
|
const field2 = compileFieldValue(
|
|
2256
2261
|
orderSpec.field,
|
|
2257
2262
|
dialect,
|
|
@@ -2298,8 +2303,14 @@ function buildStandardGroupBy(input) {
|
|
|
2298
2303
|
if (allFields.length === 0) {
|
|
2299
2304
|
return void 0;
|
|
2300
2305
|
}
|
|
2306
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2301
2307
|
const parts = allFields.map(
|
|
2302
|
-
(field2) => compileFieldValue(
|
|
2308
|
+
(field2) => compileFieldValue(
|
|
2309
|
+
field2,
|
|
2310
|
+
dialect,
|
|
2311
|
+
field2.valueType,
|
|
2312
|
+
aliasToCte.get(field2.alias) ?? `cte_${field2.alias}`
|
|
2313
|
+
)
|
|
2303
2314
|
);
|
|
2304
2315
|
return sql`GROUP BY ${sql.join(parts, sql`, `)}`;
|
|
2305
2316
|
}
|
|
@@ -2374,6 +2385,7 @@ function buildStandardVectorOrderBy(input) {
|
|
|
2374
2385
|
const distanceOrder = sql`cte_embeddings.distance ASC`;
|
|
2375
2386
|
const additionalOrders = [];
|
|
2376
2387
|
if (ast.orderBy && ast.orderBy.length > 0) {
|
|
2388
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2377
2389
|
for (const orderSpec of ast.orderBy) {
|
|
2378
2390
|
const valueType = orderSpec.field.valueType;
|
|
2379
2391
|
if (valueType === "array" || valueType === "object") {
|
|
@@ -2381,7 +2393,7 @@ function buildStandardVectorOrderBy(input) {
|
|
|
2381
2393
|
"Ordering by JSON arrays or objects is not supported"
|
|
2382
2394
|
);
|
|
2383
2395
|
}
|
|
2384
|
-
const cteAlias = `cte_${orderSpec.field.alias}`;
|
|
2396
|
+
const cteAlias = aliasToCte.get(orderSpec.field.alias) ?? `cte_${orderSpec.field.alias}`;
|
|
2385
2397
|
const field2 = compileFieldValue(
|
|
2386
2398
|
orderSpec.field,
|
|
2387
2399
|
dialect,
|
|
@@ -3851,6 +3863,16 @@ function mapSubgraphEdgeRow(row, projectionPlan) {
|
|
|
3851
3863
|
applyProjectedFields(projectedEdge, row, kindPlan);
|
|
3852
3864
|
return projectedEdge;
|
|
3853
3865
|
}
|
|
3866
|
+
|
|
3867
|
+
// src/query/ast.ts
|
|
3868
|
+
function mergeEdgeKinds(traversal) {
|
|
3869
|
+
const inverse = traversal.inverseEdgeKinds;
|
|
3870
|
+
if (inverse === void 0 || inverse.length === 0) return traversal.edgeKinds;
|
|
3871
|
+
return [
|
|
3872
|
+
...traversal.edgeKinds,
|
|
3873
|
+
...inverse.filter((kind) => !traversal.edgeKinds.includes(kind))
|
|
3874
|
+
];
|
|
3875
|
+
}
|
|
3854
3876
|
var OPERATOR_MAP = {
|
|
3855
3877
|
union: "UNION",
|
|
3856
3878
|
unionAll: "UNION ALL",
|
|
@@ -5433,16 +5455,6 @@ function getStreamBatchSize(options) {
|
|
|
5433
5455
|
return options?.batchSize ?? DEFAULT_STREAM_BATCH_SIZE;
|
|
5434
5456
|
}
|
|
5435
5457
|
|
|
5436
|
-
// src/query/ast.ts
|
|
5437
|
-
function mergeEdgeKinds(traversal) {
|
|
5438
|
-
const inverse = traversal.inverseEdgeKinds;
|
|
5439
|
-
if (inverse === void 0 || inverse.length === 0) return traversal.edgeKinds;
|
|
5440
|
-
return [
|
|
5441
|
-
...traversal.edgeKinds,
|
|
5442
|
-
...inverse.filter((kind) => !traversal.edgeKinds.includes(kind))
|
|
5443
|
-
];
|
|
5444
|
-
}
|
|
5445
|
-
|
|
5446
5458
|
// src/query/execution/field-tracker.ts
|
|
5447
5459
|
var OBJECT_PROTOTYPE_PROPERTIES = /* @__PURE__ */ new Set([
|
|
5448
5460
|
"__proto__",
|
|
@@ -6562,11 +6574,33 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
6562
6574
|
* Orders results.
|
|
6563
6575
|
*/
|
|
6564
6576
|
orderBy(alias, field2, direction = "asc") {
|
|
6565
|
-
const
|
|
6566
|
-
(traversal) => traversal.
|
|
6567
|
-
)
|
|
6568
|
-
const
|
|
6569
|
-
const
|
|
6577
|
+
const edgeTraversal = this.#state.traversals.find(
|
|
6578
|
+
(traversal) => traversal.edgeAlias === alias
|
|
6579
|
+
);
|
|
6580
|
+
const isEdge = edgeTraversal !== void 0;
|
|
6581
|
+
const isSystem = field2 === "id" || field2 === "kind" || isEdge && (field2 === "from_id" || field2 === "to_id");
|
|
6582
|
+
let typeInfo;
|
|
6583
|
+
if (!isSystem) {
|
|
6584
|
+
if (isEdge) {
|
|
6585
|
+
const edgeKindNames = mergeEdgeKinds(edgeTraversal);
|
|
6586
|
+
typeInfo = this.#config.schemaIntrospector.getSharedEdgeFieldTypeInfo(
|
|
6587
|
+
edgeKindNames,
|
|
6588
|
+
field2
|
|
6589
|
+
);
|
|
6590
|
+
} else {
|
|
6591
|
+
const kindNames = alias === this.#state.startAlias ? this.#state.startKinds : this.#state.traversals.find(
|
|
6592
|
+
(traversal) => traversal.nodeAlias === alias
|
|
6593
|
+
)?.nodeKinds;
|
|
6594
|
+
typeInfo = kindNames ? this.#config.schemaIntrospector.getSharedFieldTypeInfo(
|
|
6595
|
+
kindNames,
|
|
6596
|
+
field2
|
|
6597
|
+
) : void 0;
|
|
6598
|
+
}
|
|
6599
|
+
}
|
|
6600
|
+
const orderSpec = isSystem ? {
|
|
6601
|
+
field: fieldRef(alias, [field2], { valueType: "string" }),
|
|
6602
|
+
direction
|
|
6603
|
+
} : {
|
|
6570
6604
|
field: fieldRef(alias, ["props"], {
|
|
6571
6605
|
jsonPointer: jsonPointer([field2]),
|
|
6572
6606
|
valueType: typeInfo?.valueType,
|
|
@@ -8110,8 +8144,13 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
8110
8144
|
* Orders results.
|
|
8111
8145
|
*/
|
|
8112
8146
|
orderBy(alias, field2, direction = "asc") {
|
|
8113
|
-
const
|
|
8114
|
-
const
|
|
8147
|
+
const edgeKindNames = this.#getEdgeKindNamesForAlias(alias);
|
|
8148
|
+
const isEdge = edgeKindNames !== void 0;
|
|
8149
|
+
const isSystem = field2 === "id" || field2 === "kind" || isEdge && (field2 === "from_id" || field2 === "to_id");
|
|
8150
|
+
const typeInfo = isSystem ? void 0 : isEdge ? this.#config.schemaIntrospector.getSharedEdgeFieldTypeInfo(
|
|
8151
|
+
edgeKindNames,
|
|
8152
|
+
field2
|
|
8153
|
+
) : this.#getOrderByTypeInfo(alias, field2);
|
|
8115
8154
|
const orderSpec = isSystem ? {
|
|
8116
8155
|
field: fieldRef(alias, [field2], { valueType: "string" }),
|
|
8117
8156
|
direction
|