Skip to content

Commit aa1b5e8

Browse files
committed
fix adding multiple relations
1 parent 8084aa1 commit aa1b5e8

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

packages/hypergraph/src/entity/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export const create = <const S extends Schema.Schema.AnyNoContext>(handle: DocHa
4040
for (const prop of ast.propertySignatures) {
4141
const result = SchemaAST.getAnnotation<string>(PropertyIdSymbol)(prop.type);
4242
if (Option.isSome(result) && isRelation(prop.type)) {
43-
const relationId = generateId();
4443
if (encoded[result.value]) {
4544
for (const toEntityId of encoded[result.value] as string[]) {
45+
const relationId = generateId();
4646
relations[relationId] = {
4747
from: entityId,
4848
to: toEntityId as string,

packages/hypergraph/src/entity/findMany.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ const subscribeToDocumentChanges = (handle: DocHandle<DocumentContent>) => {
7373
const entity = doc.entities?.[entityId];
7474
if (!hasValidTypesProperty(entity)) continue;
7575
for (const typeId of entity['@@types@@']) {
76-
console.log('typeId', typeId);
7776
if (typeof typeId !== 'string') continue;
7877
const cacheEntry = decodedEntitiesCache.get(typeId);
79-
console.log('cacheEntry', cacheEntry);
8078
if (!cacheEntry) continue;
8179

8280
let includeFromAllQueries = {};

0 commit comments

Comments
 (0)