@btravstack/graphql-server 0.32.0 → 0.34.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/README.md CHANGED
@@ -32,8 +32,7 @@ options stay on `graphql()`.
32
32
 
33
33
  Pass `units` with `unit` to check each injected port against the module the
34
34
  selected request kind actually forks. `GraphqlModule` binds that record to
35
- the runtime automatically; a manually composed root passes the same `units`
36
- record to `httpServer({ unit: units })`.
35
+ the runtime automatically.
37
36
  Yoga plugins and CORS policy are explicit
38
37
  options; the wildcard CORS default and Yoga console logging are disabled, and
39
38
  a masked defect is reported to `Observers` instead. GraphiQL,
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
- let _btravstack_http_server = require("@btravstack/http-server");
8
+ require("@btravstack/http-server");
9
9
  //#region src/field.ts
10
10
  /**
11
11
  * A resolver's answer from a `Result`, so a modeled failure is never thrown by
@@ -168,7 +168,7 @@ const graphql = (api, options) => {
168
168
  //#region src/graphql-module.ts
169
169
  /** Declare a GraphQL HTTP application without repeating runtime or authenticator wiring. */
170
170
  const GraphqlModule = (name) => (options) => {
171
- const starter = (0, _btravstack_http_server.httpServer)({
171
+ const starter = (0, _btravstack_http_server_internal.httpServer)({
172
172
  ...options,
173
173
  unit: options.answerer.units
174
174
  });
@@ -182,7 +182,7 @@ const GraphqlModule = (name) => (options) => {
182
182
  imports,
183
183
  provides,
184
184
  exports: [...(0, _btravstack_http_server_internal.applicationExports)(imports, provides), ...options.exports ?? []],
185
- needs: [...options.needs ?? [], _btravstack_config.Env]
185
+ needs: options.needs === void 0 ? void 0 : [...options.needs, _btravstack_config.Env]
186
186
  });
187
187
  };
188
188
  //#endregion
package/dist/index.d.cts CHANGED
@@ -108,9 +108,9 @@ type AuthOf<A> = A extends {
108
108
  type HttpStarter<Units> = Module<HttpRuntime | HttpConfig$1 | InstanceType<typeof HttpHandler$1> | HttpUnit | CookieSchemes | Observers, ConfigInvalid, HttpServerEnv | UnitsNeedsOf<Units>>;
109
109
  type Imports<I extends readonly AnyModule[], A> = readonly [...I, HttpStarter<UnitsOf$1<A>>];
110
110
  type Provides<P extends readonly AnyProvider[], A> = readonly (A | AuthOf<A> | P[number])[];
111
- type EnvAnd<N extends readonly AnyPort[]> = readonly [...N, typeof Env];
111
+ type EnvAnd<N extends readonly AnyPort[] | undefined> = N extends readonly AnyPort[] ? readonly [...N, typeof Env] : undefined;
112
112
  /** Declare a GraphQL HTTP application without repeating runtime or authenticator wiring. */
113
- export declare const GraphqlModule: <const Name extends string>(name: Name) => <A extends AnyAnswerer, const I extends readonly AnyModule[] = [], const P extends readonly AnyProvider[] = [], const X extends readonly Exportable<Imports<I, A>, Provides<P, A>>[] = [], const N extends readonly AnyPort[] = []>(options: Omit<HttpOptions, "unit" | "cors" | "compression"> & {
113
+ export declare const GraphqlModule: <const Name extends string>(name: Name) => <A extends AnyAnswerer, const I extends readonly AnyModule[] = [], const P extends readonly AnyProvider[] = [], const X extends readonly Exportable<Imports<I, A>, Provides<P, A>>[] = [], const N extends readonly AnyPort[] | undefined = undefined>(options: Omit<HttpOptions, "unit" | "cors" | "compression"> & {
114
114
  readonly answerer: A;
115
115
  readonly imports?: I;
116
116
  readonly provides?: P;
package/dist/index.d.mts CHANGED
@@ -108,9 +108,9 @@ type AuthOf<A> = A extends {
108
108
  type HttpStarter<Units> = Module<HttpRuntime | HttpConfig$1 | InstanceType<typeof HttpHandler$1> | HttpUnit | CookieSchemes | Observers, ConfigInvalid, HttpServerEnv | UnitsNeedsOf<Units>>;
109
109
  type Imports<I extends readonly AnyModule[], A> = readonly [...I, HttpStarter<UnitsOf$1<A>>];
110
110
  type Provides<P extends readonly AnyProvider[], A> = readonly (A | AuthOf<A> | P[number])[];
111
- type EnvAnd<N extends readonly AnyPort[]> = readonly [...N, typeof Env];
111
+ type EnvAnd<N extends readonly AnyPort[] | undefined> = N extends readonly AnyPort[] ? readonly [...N, typeof Env] : undefined;
112
112
  /** Declare a GraphQL HTTP application without repeating runtime or authenticator wiring. */
113
- export declare const GraphqlModule: <const Name extends string>(name: Name) => <A extends AnyAnswerer, const I extends readonly AnyModule[] = [], const P extends readonly AnyProvider[] = [], const X extends readonly Exportable<Imports<I, A>, Provides<P, A>>[] = [], const N extends readonly AnyPort[] = []>(options: Omit<HttpOptions, "unit" | "cors" | "compression"> & {
113
+ export declare const GraphqlModule: <const Name extends string>(name: Name) => <A extends AnyAnswerer, const I extends readonly AnyModule[] = [], const P extends readonly AnyProvider[] = [], const X extends readonly Exportable<Imports<I, A>, Provides<P, A>>[] = [], const N extends readonly AnyPort[] | undefined = undefined>(options: Omit<HttpOptions, "unit" | "cors" | "compression"> & {
114
114
  readonly answerer: A;
115
115
  readonly imports?: I;
116
116
  readonly provides?: P;
package/dist/index.mjs CHANGED
@@ -2,9 +2,9 @@ import { createGraphQLError, createYoga, handleStreamOrSingleExecutionResult, ma
2
2
  import { Config, Env } from "@btravstack/config";
3
3
  import { Observers, observe } from "@btravstack/core";
4
4
  import { Module, Provider } from "@btravstack/di";
5
- import { HttpConfig, HttpHandler, HttpUnit, applicationExports, forkUnit, principalOf, resolveScheme, schemeDeps, schemeServices } from "@btravstack/http-server/internal";
5
+ import { HttpConfig, HttpHandler, HttpUnit, applicationExports, forkUnit, httpServer, principalOf, resolveScheme, schemeDeps, schemeServices } from "@btravstack/http-server/internal";
6
6
  import { P } from "unthrown";
7
- import { httpServer } from "@btravstack/http-server";
7
+ import "@btravstack/http-server";
8
8
  //#region src/field.ts
9
9
  /**
10
10
  * A resolver's answer from a `Result`, so a modeled failure is never thrown by
@@ -181,7 +181,7 @@ const GraphqlModule = (name) => (options) => {
181
181
  imports,
182
182
  provides,
183
183
  exports: [...applicationExports(imports, provides), ...options.exports ?? []],
184
- needs: [...options.needs ?? [], Env]
184
+ needs: options.needs === void 0 ? void 0 : [...options.needs, Env]
185
185
  });
186
186
  };
187
187
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btravstack/graphql-server",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "The GraphQL Yoga answerer for @btravstack/http-server",
5
5
  "keywords": [
6
6
  "graphql",
@@ -41,11 +41,11 @@
41
41
  "./package.json": "./package.json"
42
42
  },
43
43
  "devDependencies": {
44
- "@btravstack/config": "0.32.0",
45
- "@btravstack/contract": "0.32.0",
46
- "@btravstack/core": "0.32.0",
47
- "@btravstack/di": "0.32.0",
48
- "@btravstack/http-server": "0.32.0",
44
+ "@btravstack/config": "0.34.0",
45
+ "@btravstack/contract": "0.34.0",
46
+ "@btravstack/core": "0.34.0",
47
+ "@btravstack/di": "0.34.0",
48
+ "@btravstack/http-server": "0.34.0",
49
49
  "@btravstack/tsconfig": "0.4.0",
50
50
  "@types/node": "26.6.4",
51
51
  "@unthrown/vitest": "5.12.1",
@@ -59,11 +59,11 @@
59
59
  "vitest": "5.0.3"
60
60
  },
61
61
  "peerDependencies": {
62
- "@btravstack/config": "^0.32.0",
63
- "@btravstack/contract": "^0.32.0",
64
- "@btravstack/core": "^0.32.0",
65
- "@btravstack/di": "^0.32.0",
66
- "@btravstack/http-server": "^0.32.0",
62
+ "@btravstack/config": "^0.34.0",
63
+ "@btravstack/contract": "^0.34.0",
64
+ "@btravstack/core": "^0.34.0",
65
+ "@btravstack/di": "^0.34.0",
66
+ "@btravstack/http-server": "^0.34.0",
67
67
  "graphql": "^16.6.0 || ^17.0.0",
68
68
  "graphql-yoga": "^5.24.1",
69
69
  "unthrown": "^5.7.0"