graphile-schema 1.9.6 → 1.10.1
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/build-schema.js +10 -9
- package/esm/build-schema.js +10 -6
- package/package.json +5 -6
package/build-schema.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.buildSchemaSDL = buildSchemaSDL;
|
|
7
|
-
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
8
4
|
const graphql_1 = require("graphql");
|
|
9
5
|
const graphile_settings_1 = require("graphile-settings");
|
|
10
6
|
const graphile_build_1 = require("graphile-build");
|
|
@@ -19,8 +15,16 @@ async function buildSchemaSDL(opts) {
|
|
|
19
15
|
// Without this, makePgService creates its own internal pool that isn't released,
|
|
20
16
|
// causing "database has active sessions" errors during ephemeral DB teardown.
|
|
21
17
|
const pool = (0, pg_cache_1.getPgPool)(config);
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
// Compose presets using Graphile's native `extends` mechanism instead of
|
|
19
|
+
// deepmerge. deepmerge recursively clones every nested object — including
|
|
20
|
+
// the pg Pool (EventEmitter internals) and the entire PostGraphile preset
|
|
21
|
+
// tree — which overflows the call stack.
|
|
22
|
+
const preset = {
|
|
23
|
+
extends: [
|
|
24
|
+
graphile_settings_1.ConstructivePreset,
|
|
25
|
+
...(opts.graphile?.extends ?? []),
|
|
26
|
+
],
|
|
27
|
+
plugins: opts.graphile?.plugins ?? [],
|
|
24
28
|
pgServices: [
|
|
25
29
|
(0, graphile_settings_1.makePgService)({
|
|
26
30
|
pool,
|
|
@@ -28,9 +32,6 @@ async function buildSchemaSDL(opts) {
|
|
|
28
32
|
}),
|
|
29
33
|
],
|
|
30
34
|
};
|
|
31
|
-
const preset = opts.graphile
|
|
32
|
-
? (0, deepmerge_1.default)(basePreset, opts.graphile)
|
|
33
|
-
: basePreset;
|
|
34
35
|
const { schema } = await (0, graphile_build_1.makeSchema)(preset);
|
|
35
36
|
return (0, graphql_1.printSchema)(schema);
|
|
36
37
|
}
|
package/esm/build-schema.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import deepmerge from 'deepmerge';
|
|
2
1
|
import { printSchema } from 'graphql';
|
|
3
2
|
import { ConstructivePreset, makePgService } from 'graphile-settings';
|
|
4
3
|
import { makeSchema } from 'graphile-build';
|
|
@@ -13,8 +12,16 @@ export async function buildSchemaSDL(opts) {
|
|
|
13
12
|
// Without this, makePgService creates its own internal pool that isn't released,
|
|
14
13
|
// causing "database has active sessions" errors during ephemeral DB teardown.
|
|
15
14
|
const pool = getPgPool(config);
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
// Compose presets using Graphile's native `extends` mechanism instead of
|
|
16
|
+
// deepmerge. deepmerge recursively clones every nested object — including
|
|
17
|
+
// the pg Pool (EventEmitter internals) and the entire PostGraphile preset
|
|
18
|
+
// tree — which overflows the call stack.
|
|
19
|
+
const preset = {
|
|
20
|
+
extends: [
|
|
21
|
+
ConstructivePreset,
|
|
22
|
+
...(opts.graphile?.extends ?? []),
|
|
23
|
+
],
|
|
24
|
+
plugins: opts.graphile?.plugins ?? [],
|
|
18
25
|
pgServices: [
|
|
19
26
|
makePgService({
|
|
20
27
|
pool,
|
|
@@ -22,9 +29,6 @@ export async function buildSchemaSDL(opts) {
|
|
|
22
29
|
}),
|
|
23
30
|
],
|
|
24
31
|
};
|
|
25
|
-
const preset = opts.graphile
|
|
26
|
-
? deepmerge(basePreset, opts.graphile)
|
|
27
|
-
: basePreset;
|
|
28
32
|
const { schema } = await makeSchema(preset);
|
|
29
33
|
return printSchema(schema);
|
|
30
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-schema",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Build GraphQL SDL from PostgreSQL databases using PostGraphile v5",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,13 +29,12 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"deepmerge": "^4.3.1",
|
|
33
32
|
"graphile-build": "5.0.0-rc.6",
|
|
34
33
|
"graphile-config": "1.0.0-rc.6",
|
|
35
|
-
"graphile-settings": "^4.
|
|
34
|
+
"graphile-settings": "^4.16.0",
|
|
36
35
|
"graphql": "16.13.0",
|
|
37
|
-
"pg-cache": "^3.
|
|
38
|
-
"pg-env": "^1.
|
|
36
|
+
"pg-cache": "^3.4.0",
|
|
37
|
+
"pg-env": "^1.8.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"makage": "^0.1.10",
|
|
@@ -50,5 +49,5 @@
|
|
|
50
49
|
"introspection",
|
|
51
50
|
"constructive"
|
|
52
51
|
],
|
|
53
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "cedb1963bbae9beb2592474151b19cbd56df4772"
|
|
54
53
|
}
|