@loradb/lora-graphql 0.17.0 → 0.18.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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { D as e, L as r, a as o, M as l, b as i, c as d, d as n, e as t, f, g as m, i as p, l as c, p as h, r as D, s as b, h as u, t as v, v as L } from "./driver-BmnRtkpd.js";
2
- import { d as x } from "./diff-8nsBSSNP.js";
1
+ import { D as e, L as r, a as o, M as l, b as i, c as d, d as n, e as t, f, g as m, i as p, l as c, p as h, r as D, s as b, h as u, t as v, v as L } from "./driver-CQj9gkvl.js";
2
+ import { d as x } from "./diff-fpWH5KUa.js";
3
3
  export {
4
4
  e as DEFAULT_GUARDS,
5
5
  r as LoraGraphQL,
@@ -81,14 +81,15 @@ export interface LoraGraphQLOptions extends ModelOptions, ObservabilityOptions {
81
81
  /** Called with every database error, masked or not. */
82
82
  onError?: (event: DatabaseErrorEvent) => void;
83
83
  /**
84
- * Limits on the documents `execute()` and `persist()` accept: depth,
84
+ * Limits on the documents `execute()`, `subscribe()` and `persist()`
85
+ * accept: depth,
85
86
  * aliases, root fields, tokens, introspection. `false` turns them off.
86
87
  * For other servers use `validationRules()` or `envelopPlugin()`.
87
88
  */
88
89
  guards?: DocumentGuards | false;
89
90
  /**
90
- * Make `execute()` refuse `source` and run only persisted operations
91
- * by `id`. Default false.
91
+ * Make `execute()` and `subscribe()` refuse `source` and run only
92
+ * persisted operations by `id`. Default false.
92
93
  */
93
94
  persistedOnly?: boolean;
94
95
  }
@@ -270,10 +271,20 @@ export declare class LoraGraphQL {
270
271
  */
271
272
  loadManifest(manifest: OperationManifest): void;
272
273
  /**
273
- * Execute an operation against the schema. Parsed and validated
274
- * documents are cached by source text; persisted ones by id.
274
+ * Execute a query or mutation against the schema. Parsed and validated
275
+ * documents are cached by source text; persisted ones by id. A
276
+ * subscription runs with {@link LoraGraphQL.subscribe}.
275
277
  */
276
278
  execute(args: ExecuteArgs): Promise<ExecutionResult>;
279
+ /**
280
+ * Run a subscription: an async iterable of results, one per event, or a
281
+ * single result with the errors when it cannot start (an unknown id, a
282
+ * validation error, a denied subscribe). Takes the same arguments as
283
+ * {@link LoraGraphQL.execute}, a persisted id included, with the same
284
+ * document cache and guards. End it with `return()` on the iterator, or
285
+ * with an `AbortSignal` passed as `context.signal`.
286
+ */
287
+ subscribe(args: ExecuteArgs): Promise<AsyncIterableIterator<ExecutionResult> | ExecutionResult>;
277
288
  /** Called after every committed mutation with its exact write-set. */
278
289
  onWrite(listener: (change: WriteChange) => void): () => void;
279
290
  /**
package/dist/testing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { graphql as h } from "graphql";
2
- import { L as w, l as u } from "./driver-BmnRtkpd.js";
2
+ import { L as w, l as u } from "./driver-CQj9gkvl.js";
3
3
  async function L(l) {
4
4
  let s;
5
5
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loradb/lora-graphql",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Schema-first GraphQL for LoraDB: one annotated SDL becomes an executable, index-aware GraphQL API that compiles every operation to a single Cypher statement.",
5
5
  "license": "BUSL-1.1",
6
6
  "packageManager": "yarn@4.5.1",
@@ -64,7 +64,7 @@
64
64
  "bench": "vitest bench --run"
65
65
  },
66
66
  "peerDependencies": {
67
- "@loradb/lora-node": "^0.17.0",
67
+ "@loradb/lora-node": "^0.18.0",
68
68
  "graphql": "^16.8.0 || ^17.0.0"
69
69
  },
70
70
  "devDependencies": {