@@ -72,6 +72,47 @@ inclusion: always
7272- ** External Data** : Graph data is queried directly from the connected graph
7373 databases and is not owned or persisted by Graph Explorer
7474
75+ ## Schema Storage
76+
77+ Schema discovery is expensive in both time and database compute, so the
78+ discovered schema is persisted in IndexedDB (via localforage) as a
79+ ` SchemaStorageModel ` . This acts as a persistent cache per connection.
80+
81+ Key files:
82+
83+ - ` src/core/StateProvider/schema.ts ` — ` SchemaStorageModel ` type, Jotai atoms,
84+ and incremental update logic
85+ - ` src/core/ConfigurationProvider/types.ts ` — ` EdgeConnection ` ,
86+ ` VertexTypeConfig ` , ` EdgeTypeConfig ` , and related types
87+ - ` src/hooks/useSchemaSync.ts ` — schema sync orchestration
88+ - ` src/connector/queries/edgeConnectionsQuery.ts ` — edge connection discovery
89+
90+ ### Edge Connections
91+
92+ Edge connections (` EdgeConnection[] ` ) describe relationships between vertex
93+ types and are used by the Schema Explorer feature. Because the edge connection
94+ query can be expensive and unreliable, it runs separately from the main schema
95+ sync so that a failure only affects Schema Explorer — all other features work
96+ without edge connections.
97+
98+ The ` edgeConnections ` property on ` SchemaStorageModel ` has three meaningful
99+ states:
100+
101+ - ` undefined ` — edge connections have not been successfully discovered (query
102+ not run or errored)
103+ - ` [] ` (empty array) — query succeeded but no edge connections exist
104+ - populated array — query succeeded with results
105+
106+ If the edge connection query fails, the error is stored in the schema via the
107+ ` edgeConnectionDiscoveryFailed ` flag.
108+
109+ ### Incremental Schema Growth
110+
111+ As users explore the graph, queries may return vertex/edge types or attributes
112+ not present in the initial schema sync. These are automatically merged into the
113+ stored schema via ` updateSchemaFromEntities() ` , causing the schema to grow more
114+ complete over time.
115+
75116## Branded Types
76117
77118The project uses branded types from ` @/utils ` for type safety. These prevent
0 commit comments