Skip to content

Commit bb94bc6

Browse files
committed
cleanup
1 parent dc9cc6b commit bb94bc6

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

apps/events/src/Boot.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { HypergraphAppProvider } from '@graphprotocol/hypergraph-react';
22
import { createRouter, RouterProvider } from '@tanstack/react-router';
3-
import { mapping } from './mapping.js';
43
import { routeTree } from './routeTree.gen';
54

65
// Create a new router instance
@@ -15,11 +14,7 @@ declare module '@tanstack/react-router' {
1514

1615
export function Boot() {
1716
return (
18-
<HypergraphAppProvider
19-
syncServerUri="http://localhost:3030"
20-
mapping={mapping}
21-
appId="93bb8907-085a-4a0e-83dd-62b0dc98e793"
22-
>
17+
<HypergraphAppProvider syncServerUri="http://localhost:3030" appId="93bb8907-085a-4a0e-83dd-62b0dc98e793">
2318
<RouterProvider router={router} />
2419
</HypergraphAppProvider>
2520
);

packages/hypergraph/src/entity/create.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ export const create = <const S extends Schema.Schema.AnyNoContext>(handle: DocHa
3838
const result = SchemaAST.getAnnotation<string>(PropertyIdSymbol)(prop.type);
3939
if (Option.isSome(result) && isRelation(prop.type)) {
4040
const relationId = generateId();
41-
for (const toEntityId of encoded[result.value] as string[]) {
42-
relations[relationId] = {
43-
from: entityId,
44-
to: toEntityId as string,
45-
fromPropertyId: result.value,
46-
__deleted: false,
47-
};
41+
if (encoded[result.value]) {
42+
for (const toEntityId of encoded[result.value] as string[]) {
43+
relations[relationId] = {
44+
from: entityId,
45+
to: toEntityId as string,
46+
fromPropertyId: result.value,
47+
__deleted: false,
48+
};
49+
}
4850
}
4951
delete encoded[result.value];
5052
}

packages/hypergraph/src/entity/findMany.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const subscribeToDocumentChanges = (handle: DocHandle<DocumentContent>) => {
9191
id: entityId,
9292
});
9393
decoded = {
94+
// @ts-expect-error
9495
...decoded,
9596
...relations,
9697
};

0 commit comments

Comments
 (0)