@loradb/lora-graphql 0.20.1 → 0.21.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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { LoraGraphQL, type AssertSchemaOptions, type CheckOptions, type CheckReport, type CostEvent, type DatabaseErrorEvent, type ExecuteArgs, type LoraGraphQLContext, type LoraGraphQLOptions, type SchemaAssertion, type StatementEvent, } from './lora-graphql.js';
1
+ export { LoraGraphQL, type AssertSchemaOptions, type CheckOptions, type CheckReport, type CostEvent, type DatabaseErrorEvent, type ExecuteArgs, type ExecutionTiming, type LoraGraphQLContext, type LoraGraphQLOptions, type SchemaAssertion, type StatementEvent, } from './lora-graphql.js';
2
2
  export { loraDriver, type DriverTransaction, type LoraDatabaseLike, type LoraDriver, type QueryPlan, type QueryResult, type RunOptions, type Statement, } from './driver.js';
3
3
  export { directiveTypeDefs } from './model/directives.js';
4
4
  export { buildModel, type ModelOptions } from './model/build.js';
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-XeJM24iP.js";
2
- import { d as x } from "./diff-BO2igqdY.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-DAtBEMWj.js";
2
+ import { d as x } from "./diff-CcRU-3_p.js";
3
3
  export {
4
4
  e as DEFAULT_GUARDS,
5
5
  r as LoraGraphQL,
@@ -104,6 +104,27 @@ export interface LoraGraphQLOptions extends ModelOptions, ObservabilityOptions {
104
104
  * putting a `lora.begin()` transaction in the context.
105
105
  */
106
106
  mutationTransaction?: "field" | "operation";
107
+ /**
108
+ * Add `extensions.timing` to `execute()` results: the request's total
109
+ * time, the time spent in LoraDB, and both per root field, in
110
+ * milliseconds. `true` for every request, or a function deciding per
111
+ * request from the GraphQL context (for example only for admins or in
112
+ * development). Default off: timings sent to clients can act as a
113
+ * timing side channel.
114
+ */
115
+ timing?: boolean | ((context: unknown) => boolean);
116
+ }
117
+ /** `extensions.timing` of an `execute()` result (see the `timing` option). */
118
+ export interface ExecutionTiming {
119
+ /** The whole `execute()` call: parse, validation, execution. */
120
+ totalMs: number;
121
+ /** Time spent running statements in LoraDB. */
122
+ databaseMs: number;
123
+ /** Per root field, by response key (alias or name). */
124
+ fields: Record<string, {
125
+ totalMs: number;
126
+ databaseMs: number;
127
+ }>;
107
128
  }
108
129
  export interface CostEvent {
109
130
  field: string;
package/dist/testing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { graphql as g } from "graphql";
2
- import { L as h, l as b } from "./driver-XeJM24iP.js";
2
+ import { L as h, l as b } from "./driver-DAtBEMWj.js";
3
3
  async function T(l) {
4
4
  let u;
5
5
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loradb/lora-graphql",
3
- "version": "0.20.1",
3
+ "version": "0.21.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",
@@ -65,7 +65,7 @@
65
65
  "bench:load": "node bench/load/main.mjs"
66
66
  },
67
67
  "peerDependencies": {
68
- "@loradb/lora-node": "^0.20.1",
68
+ "@loradb/lora-node": "^0.21.0",
69
69
  "graphql": "^16.8.0 || ^17.0.0"
70
70
  },
71
71
  "devDependencies": {