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 11import { HypergraphAppProvider } from '@graphprotocol/hypergraph-react' ;
22import { createRouter , RouterProvider } from '@tanstack/react-router' ;
3- import { mapping } from './mapping.js' ;
43import { routeTree } from './routeTree.gen' ;
54
65// Create a new router instance
@@ -15,11 +14,7 @@ declare module '@tanstack/react-router' {
1514
1615export 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 ) ;
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
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 }
Original file line number Diff line number Diff 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 } ;
You can’t perform that action at this time.
0 commit comments