From 1c3ce30857b6265fc9c7854426cf564c2ecf4651 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Mon, 19 May 2025 21:38:03 +0200 Subject: [PATCH] fix deprecation warning --- packages/hypergraph-react/src/HypergraphSpaceContext.tsx | 2 +- packages/hypergraph/src/entity/findMany.ts | 2 +- packages/hypergraph/src/entity/findOne.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hypergraph-react/src/HypergraphSpaceContext.tsx b/packages/hypergraph-react/src/HypergraphSpaceContext.tsx index 6f0b70e5..a51bee1e 100644 --- a/packages/hypergraph-react/src/HypergraphSpaceContext.tsx +++ b/packages/hypergraph-react/src/HypergraphSpaceContext.tsx @@ -153,7 +153,7 @@ export function useQueryEntity( }; return useSyncExternalStore(subscribe, () => { - const doc = hypergraph.handle.docSync(); + const doc = hypergraph.handle.doc(); if (doc === undefined) { return prevEntityRef.current; } diff --git a/packages/hypergraph/src/entity/findMany.ts b/packages/hypergraph/src/entity/findMany.ts index 7b5c3a9d..cf5f6a7d 100644 --- a/packages/hypergraph/src/entity/findMany.ts +++ b/packages/hypergraph/src/entity/findMany.ts @@ -246,7 +246,7 @@ export function findMany( // @ts-expect-error name is defined const typeName = type.name; - const doc = handle.docSync(); + const doc = handle.doc(); if (!doc) { return { entities: [], corruptEntityIds: [] }; } diff --git a/packages/hypergraph/src/entity/findOne.ts b/packages/hypergraph/src/entity/findOne.ts index 0db3d9e9..11470b5a 100644 --- a/packages/hypergraph/src/entity/findOne.ts +++ b/packages/hypergraph/src/entity/findOne.ts @@ -21,7 +21,7 @@ export const findOne = ( return (id: string): Entity | undefined => { // TODO: Instead of this insane filtering logic, we should be keeping track of the entities in // an index and store the decoded values instead of re-decoding over and over again. - const doc = handle.docSync(); + const doc = handle.doc(); const entity = doc?.entities?.[id]; const relations = doc ? getEntityRelations(id, type, doc, include) : {};