@btravstack/graphql-server 0.50.0 → 0.53.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.cjs CHANGED
@@ -5,7 +5,7 @@ let _btravstack_core = require("@btravstack/core");
5
5
  let _btravstack_di = require("@btravstack/di");
6
6
  let _btravstack_http_server_internal = require("@btravstack/http-server/internal");
7
7
  let unthrown = require("unthrown");
8
- //#region src/field.ts
8
+ // src/field.ts
9
9
  /**
10
10
  * A resolver's answer from a `Result`, so a modeled failure is never thrown by
11
11
  * hand. `Ok` is the field's value. `Err` is the `GraphQLError` the resolver's
@@ -28,8 +28,7 @@ const fieldResult = async (result) => {
28
28
  if (settled.isErr()) throw (0, graphql_yoga.createGraphQLError)(settled.error.message, { extensions: settled.error.extensions });
29
29
  return settled.value;
30
30
  };
31
- //#endregion
32
- //#region src/graphql.ts
31
+ // src/graphql.ts
33
32
  const dispose = Symbol("graphql.dispose");
34
33
  /** What failed: GraphQL locates a resolver's error by wrapping it, and a log line walks `cause`, not `originalError`. */
35
34
  const causeOf = (error) => typeof error === "object" && error !== null && "originalError" in error && error.originalError ? error.originalError : error;
@@ -166,7 +165,6 @@ const graphql = (api, options) => {
166
165
  units: options.units
167
166
  });
168
167
  };
169
- //#endregion
170
168
  Object.defineProperty(exports, "GraphqlModule", {
171
169
  enumerable: true,
172
170
  get: function() {
package/dist/index.d.cts CHANGED
@@ -7,7 +7,6 @@ import { Observers } from "@btravstack/core";
7
7
  import { AnyPort, Provider, Scope } from "@btravstack/di";
8
8
  import { AnswererModule as GraphqlModule, Authenticators, HttpAuth, HttpConfig, HttpHandler, HttpUnit, KindOf, Kinds, Principal, RequiresGate, SchemePortsOf, SchemesFrom, SchemesOf, UnitFor, UnitsNeedsOf, UnitsOf } from "@btravstack/http-server/internal";
9
9
  import { Plugin, YogaInitialContext, YogaServerOptions } from "graphql-yoga";
10
- //#region src/field.d.ts
11
10
  /**
12
11
  * A resolver's answer from a `Result`, so a modeled failure is never thrown by
13
12
  * hand. `Ok` is the field's value. `Err` is the `GraphQLError` the resolver's
@@ -25,8 +24,6 @@ import { Plugin, YogaInitialContext, YogaServerOptions } from "graphql-yoga";
25
24
  * resolver needs, as `runMain` is for a process.
26
25
  */
27
26
  export declare const fieldResult: <T>(result: AsyncResult<T, GraphQLError> | Result<T, GraphQLError>) => Promise<T>;
28
- //#endregion
29
- //#region src/graphql.d.ts
30
27
  type YogaCors = YogaServerOptions<Record<string, unknown>, Record<string, unknown>>["cors"];
31
28
  type MissingUnitPorts<U extends Readonly<Record<string, AnyPort>>, Units, K extends string> = Exclude<keyof U, keyof UnitFor<U, Units, K>>;
32
29
  type UnitGate<U extends Readonly<Record<string, AnyPort>>, Units, K extends string> = [MissingUnitPorts<U, Units, K>] extends [never] ? unknown : {
@@ -92,5 +89,4 @@ export declare const graphql: <A extends Authenticators, Units extends UnitsOf<A
92
89
  authenticators: readonly import("@btravstack/http-server/internal").SchemeProviders<A>[];
93
90
  units: (Units & { readonly [K in Exclude<keyof Units, Kinds<A>>]: never; }) | undefined;
94
91
  };
95
- //#endregion
96
92
  export { type GraphqlContext, GraphqlModule, type GraphqlOptions };
package/dist/index.d.mts CHANGED
@@ -7,7 +7,6 @@ import { AsyncResult, Result } from "unthrown";
7
7
  import { GraphQLError, GraphQLSchema } from "graphql";
8
8
  import { IncomingMessage } from "node:http";
9
9
  import { OneScheme, Requirements } from "@btravstack/contract";
10
- //#region src/field.d.ts
11
10
  /**
12
11
  * A resolver's answer from a `Result`, so a modeled failure is never thrown by
13
12
  * hand. `Ok` is the field's value. `Err` is the `GraphQLError` the resolver's
@@ -25,8 +24,6 @@ import { OneScheme, Requirements } from "@btravstack/contract";
25
24
  * resolver needs, as `runMain` is for a process.
26
25
  */
27
26
  export declare const fieldResult: <T>(result: AsyncResult<T, GraphQLError> | Result<T, GraphQLError>) => Promise<T>;
28
- //#endregion
29
- //#region src/graphql.d.ts
30
27
  type YogaCors = YogaServerOptions<Record<string, unknown>, Record<string, unknown>>["cors"];
31
28
  type MissingUnitPorts<U extends Readonly<Record<string, AnyPort>>, Units, K extends string> = Exclude<keyof U, keyof UnitFor<U, Units, K>>;
32
29
  type UnitGate<U extends Readonly<Record<string, AnyPort>>, Units, K extends string> = [MissingUnitPorts<U, Units, K>] extends [never] ? unknown : {
@@ -92,5 +89,4 @@ export declare const graphql: <A extends Authenticators, Units extends UnitsOf<A
92
89
  authenticators: readonly import("@btravstack/http-server/internal").SchemeProviders<A>[];
93
90
  units: (Units & { readonly [K in Exclude<keyof Units, Kinds<A>>]: never; }) | undefined;
94
91
  };
95
- //#endregion
96
92
  export { type GraphqlContext, GraphqlModule, type GraphqlOptions };
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { Observers, observe } from "@btravstack/core";
4
4
  import { Provider } from "@btravstack/di";
5
5
  import { AnswererModule as GraphqlModule, HttpConfig, HttpHandler, HttpUnit, forkUnit, principalOf, resolveRequestScheme, schemeDeps, schemeServices } from "@btravstack/http-server/internal";
6
6
  import { P } from "unthrown";
7
- //#region src/field.ts
7
+ // src/field.ts
8
8
  /**
9
9
  * A resolver's answer from a `Result`, so a modeled failure is never thrown by
10
10
  * hand. `Ok` is the field's value. `Err` is the `GraphQLError` the resolver's
@@ -27,8 +27,7 @@ const fieldResult = async (result) => {
27
27
  if (settled.isErr()) throw createGraphQLError(settled.error.message, { extensions: settled.error.extensions });
28
28
  return settled.value;
29
29
  };
30
- //#endregion
31
- //#region src/graphql.ts
30
+ // src/graphql.ts
32
31
  const dispose = Symbol("graphql.dispose");
33
32
  /** What failed: GraphQL locates a resolver's error by wrapping it, and a log line walks `cause`, not `originalError`. */
34
33
  const causeOf = (error) => typeof error === "object" && error !== null && "originalError" in error && error.originalError ? error.originalError : error;
@@ -165,5 +164,4 @@ const graphql = (api, options) => {
165
164
  units: options.units
166
165
  });
167
166
  };
168
- //#endregion
169
167
  export { GraphqlModule, fieldResult, graphql };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btravstack/graphql-server",
3
- "version": "0.50.0",
3
+ "version": "0.53.0",
4
4
  "description": "The GraphQL Yoga answerer for @btravstack/http-server",
5
5
  "keywords": [
6
6
  "graphql",
@@ -41,29 +41,29 @@
41
41
  "./package.json": "./package.json"
42
42
  },
43
43
  "devDependencies": {
44
- "@btravstack/config": "0.50.0",
45
- "@btravstack/contract": "0.50.0",
46
- "@btravstack/core": "0.50.0",
47
- "@btravstack/di": "0.50.0",
48
- "@btravstack/http-server": "0.50.0",
44
+ "@btravstack/config": "0.53.0",
45
+ "@btravstack/contract": "0.53.0",
46
+ "@btravstack/core": "0.53.0",
47
+ "@btravstack/di": "0.53.0",
48
+ "@btravstack/http-server": "0.53.0",
49
49
  "@btravstack/tsconfig": "0.4.0",
50
50
  "@types/node": "26.6.5",
51
51
  "@unthrown/vitest": "5.12.1",
52
52
  "@vitest/coverage-v8": "5.0.3",
53
53
  "graphql": "17.0.2",
54
54
  "graphql-yoga": "5.24.6",
55
- "tsdown": "0.23.1",
55
+ "tsdown": "0.23.2",
56
56
  "typescript": "7.0.2",
57
57
  "typescript-consumer": "npm:typescript@5.9.3",
58
58
  "unthrown": "5.12.1",
59
59
  "vitest": "5.0.3"
60
60
  },
61
61
  "peerDependencies": {
62
- "@btravstack/config": "^0.50.0",
63
- "@btravstack/contract": "^0.50.0",
64
- "@btravstack/core": "^0.50.0",
65
- "@btravstack/di": "^0.50.0",
66
- "@btravstack/http-server": "^0.50.0",
62
+ "@btravstack/config": "^0.53.0",
63
+ "@btravstack/contract": "^0.53.0",
64
+ "@btravstack/core": "^0.53.0",
65
+ "@btravstack/di": "^0.53.0",
66
+ "@btravstack/http-server": "^0.53.0",
67
67
  "graphql": "^16.6.0 || ^17.0.0",
68
68
  "graphql-yoga": "^5.24.1",
69
69
  "unthrown": "^5.7.0"