Support checked keyed relationships across portable operations and queries

This commit is contained in:
Timothy J. Aveni
2026-09-25 12:02:05 -07:00
parent e0e8563224
commit 1bc3c69de3
23 changed files with 1203 additions and 949 deletions
+8 -1
View File
@@ -1,3 +1,6 @@
import interface PresentationStates;
import interface ReaderNavigation;
external atom ReaderNavigationRecord id "reader-navigation-record";
import interface PresentationState;
import interface PresentationMount;
import interface StateFactory;
@@ -12,7 +15,7 @@ package PresentationRuntime id "presentation-runtime" revision "presentation-run
interface metadata id "state" : PresentationState using [presentationMount.resolve,parent.resolve] from input;
};
operation ensure<object Navigation implements PresentationState> id "presentation-runtime:ensure" : record {presentationMount:interface-ref<PresentationMount>;occurrence:string;parent:optional<interface-ref<PresentationState>>;} -> ref<Navigation> mode call execution transaction targets [browser,server] receiver any requires {
edge states id "states" : many-unique object Navigation [resolve,connect];
edge states id "states" : many-unique object Navigation keyed "string" [resolve,connect];
interface metadata id "state" : PresentationState using [occurrence.get,presentationMount.resolve,parent.resolve] from input;
interface presentationMount id "presentationMount" : PresentationMount using [attach.call] from input;
interface factory id "factory" : StateFactory<Navigation> using [create.call];
@@ -20,4 +23,8 @@ package PresentationRuntime id "presentation-runtime" revision "presentation-run
function createState<object Navigation> id "presentation-runtime:create-state" : record {occurrence:string;parent:optional<interface-ref<PresentationState>>;} -> ref<Navigation> execution transaction targets [browser,server] requires {
creation navigation id "navigation" : Navigation input record {occurrence:string;parent:optional<interface-ref<PresentationState>>;};
};
query ReaderStateInputs id "reader-state:inputs" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-inputs.graphql" operation "ReaderState" { replica; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
query ReaderStateView id "reader-state:view" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-state.graphql" operation "ReaderState" { local from ReaderStateInputs; watch; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
query ReaderWindowInputs id "reader-state:window-inputs" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-window.graphql" operation "ReaderState" { replica; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
query ReaderWindowView id "reader-state:window-view" root PresentationStates<atom ReaderNavigationRecord> document "queries/reader-window.graphql" operation "ReaderState" { local from ReaderWindowInputs; watch; view ReaderNavigationRecord as ReaderNavigation; max rows 100; }
}