@gleanql/client 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alexander Liljengard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @gleanql/client
2
+
3
+ The runtime for [GleanQL](https://github.com/gleanql/gleanql) — GraphQL without
4
+ writing GraphQL. Install this in your app; the [`@gleanql/vite`](https://github.com/gleanql/gleanql/tree/main/packages/vite)
5
+ plugin generates the schema-specific pieces (the typed `glean` accessor,
6
+ compiled operations, framework glue) into it at build time.
7
+
8
+ ```tsx
9
+ import { glean } from "@gleanql/client";
10
+
11
+ export function ProductPage({ params }: { params: { handle: string } }) {
12
+ const product = glean.product({ handle: params.handle });
13
+ return <h1>{product.title}</h1>; // compiled into one operation per route
14
+ }
15
+ ```
16
+
17
+ ## What lives here
18
+
19
+ - **Normalized reactive cache** — entity + path identity, field-level
20
+ re-rendering, Suspense-aware reads, batched missing-field fetches,
21
+ reference-counted retention, LRU + staleness-aware GC.
22
+ - **Hooks** (via the generated `@gleanql/client/client` entry) — `useGlean`,
23
+ `useMutation` (optimistic fields *and* list membership, auto-rollback),
24
+ `useSubscription` (SSE or `graphql-ws`), `usePaginated`, `refresh`,
25
+ `runOperation` (typed by the generated `GleanOperations` interface),
26
+ `onEvent` (one channel for every runtime incident — wire it to Sentry).
27
+ - **Transports** — a fetch adapter with persisted-operation mode (hash-only
28
+ requests, APQ wire shape) and a `graphql-ws` adapter; anything else plugs in
29
+ behind the two-method `GraphClientAdapter` interface.
30
+ - **Server pieces** — request-scoped runtimes for SSR/RSC, hydration
31
+ serialization, `runMutation`, and `createPersistedResolver` (the server-side
32
+ persisted-operation allowlist).
33
+
34
+ ## Docs
35
+
36
+ Full documentation lives in the [GleanQL repo](https://github.com/gleanql/gleanql)
37
+ — run `pnpm docs` there, or start with the Get Started guide.
38
+
39
+ MIT