feat!: useShapeQuery lit par la requete de forme du SDK

This commit is contained in:
Sylvain Duchesne
2026-09-21 11:41:31 +02:00
parent a5e553e65b
commit 77e78ec81d
29 changed files with 1190 additions and 971 deletions
+4 -1
View File
@@ -32,7 +32,7 @@ import {
configure,
} from "@ng-eventually/polyfill";
configure({ ng: realNg, useShape: realUseShape, getSession, sharedWallet });
configure({ ng: realNg, useShape: realUseShape, ormSubscription, initNg, sharedWallet });
await ensureIdentity(); // who I am (returned), connection work awaited
// A store is named by its reference — `doc_create` takes one, and the session is where
// upstream gets it. Omit it and the document goes to the private store, as upstream does.
@@ -41,6 +41,9 @@ await docs.sparqlUpdate(sid, `INSERT DATA { … }`, doc);
// Reading is by SHAPE, over the SDK's own scope. `did:ng:i` is the whole local dataset;
// naming documents in `graphs` reads exactly those. There is no "list my documents" call
// and no way to scope a read by store — neither exists upstream.
// It reads through the SDK's own shape query (`RdfOrmSubscription.getOrCreate`, passed to
// `configure` as `ormSubscription`), and hands back the shape's own objects: `@graph`,
// `@id` and one field per predicate the shape DECLARES.
const query = useShapeQuery(NoteShape, { graphs: "did:ng:i" });
```