File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
packages/hypergraph/src/entity Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
1
import { HypergraphAppProvider } from '@graphprotocol/hypergraph-react' ;
2
2
import { createRouter , RouterProvider } from '@tanstack/react-router' ;
3
- import { mapping } from './mapping.js' ;
4
3
import { routeTree } from './routeTree.gen' ;
5
4
6
5
// Create a new router instance
@@ -15,11 +14,7 @@ declare module '@tanstack/react-router' {
15
14
16
15
export function Boot ( ) {
17
16
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" >
23
18
< RouterProvider router = { router } />
24
19
</ HypergraphAppProvider >
25
20
) ;
Original file line number Diff line number Diff line change @@ -38,13 +38,15 @@ export const create = <const S extends Schema.Schema.AnyNoContext>(handle: DocHa
38
38
const result = SchemaAST . getAnnotation < string > ( PropertyIdSymbol ) ( prop . type ) ;
39
39
if ( Option . isSome ( result ) && isRelation ( prop . type ) ) {
40
40
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
+ }
48
50
}
49
51
delete encoded [ result . value ] ;
50
52
}
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ const subscribeToDocumentChanges = (handle: DocHandle<DocumentContent>) => {
91
91
id : entityId ,
92
92
} ) ;
93
93
decoded = {
94
+ // @ts -expect-error
94
95
...decoded ,
95
96
...relations ,
96
97
} ;
You can’t perform that action at this time.
0 commit comments