Skip to content

Commit e8d331b

Browse files
authored
graceful handling of missing relation type (#267)
1 parent 9d23b41 commit e8d331b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/hypergraph-react/src/internal/use-query-public.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const convertRelations = <S extends Entity.AnyNoContext>(
205205
const rawEntity: Record<string, string | boolean | number | unknown[] | URL | Date> = {};
206206

207207
for (const [key, relationId] of Object.entries(mappingEntry?.relations ?? {})) {
208-
const properties = (queryEntity.relations ?? []).filter((a) => a.type.id === relationId);
208+
const properties = (queryEntity.relations ?? []).filter((a) => a.type?.id === relationId);
209209
if (properties.length === 0) {
210210
rawEntity[key] = [] as unknown[];
211211
continue;

0 commit comments

Comments
 (0)