@constructive-io/graphql-explorer 4.6.7 → 4.8.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/esm/server.js CHANGED
@@ -4,7 +4,7 @@ import { middleware as parseDomains } from '@constructive-io/url-domains';
4
4
  import express from 'express';
5
5
  import { createGraphileInstance, graphileCache } from 'graphile-cache';
6
6
  import { makePgService } from 'graphile-settings';
7
- import { buildConnectionString, getPgPool } from 'pg-cache';
7
+ import { getPgPool } from 'pg-cache';
8
8
  import { getPgEnvOptions } from 'pg-env';
9
9
  import { printDatabases, printSchemas } from './render';
10
10
  import { getGraphilePreset } from './settings';
@@ -21,12 +21,14 @@ export const GraphQLExplorer = (rawOpts = {}) => {
21
21
  ...pg,
22
22
  database: dbname,
23
23
  });
24
- const connectionString = buildConnectionString(pgConfig.user, pgConfig.password, pgConfig.host, pgConfig.port, pgConfig.database);
24
+ // Route through pg-cache so the pool is tracked and can be cleaned up
25
+ // properly, preventing leaked connections during database teardown.
26
+ const pool = getPgPool(pgConfig);
25
27
  const basePreset = getGraphilePreset(opts);
26
28
  const preset = {
27
29
  ...basePreset,
28
30
  pgServices: [
29
- makePgService({ connectionString, schemas: [schemaname] }),
31
+ makePgService({ pool, schemas: [schemaname] }),
30
32
  ],
31
33
  grafserv: {
32
34
  graphqlPath: '/graphql',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-explorer",
3
- "version": "4.6.7",
3
+ "version": "4.8.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive GraphQL Explorer",
6
6
  "main": "index.js",
@@ -42,7 +42,7 @@
42
42
  "grafserv": "1.0.0-rc.7",
43
43
  "graphile-cache": "^3.3.4",
44
44
  "graphile-config": "1.0.0-rc.6",
45
- "graphile-settings": "^4.10.3",
45
+ "graphile-settings": "^4.12.0",
46
46
  "graphql": "16.13.0",
47
47
  "pg-cache": "^3.3.4",
48
48
  "pg-env": "^1.7.3",
@@ -61,5 +61,5 @@
61
61
  "constructive",
62
62
  "interface"
63
63
  ],
64
- "gitHead": "3b3735292589a49601f40645ea7880f584a23b77"
64
+ "gitHead": "b8d4ae2b36e37e7f3533f858f19ec000febaa04b"
65
65
  }
package/server.js CHANGED
@@ -27,12 +27,14 @@ const GraphQLExplorer = (rawOpts = {}) => {
27
27
  ...pg,
28
28
  database: dbname,
29
29
  });
30
- const connectionString = (0, pg_cache_1.buildConnectionString)(pgConfig.user, pgConfig.password, pgConfig.host, pgConfig.port, pgConfig.database);
30
+ // Route through pg-cache so the pool is tracked and can be cleaned up
31
+ // properly, preventing leaked connections during database teardown.
32
+ const pool = (0, pg_cache_1.getPgPool)(pgConfig);
31
33
  const basePreset = (0, settings_1.getGraphilePreset)(opts);
32
34
  const preset = {
33
35
  ...basePreset,
34
36
  pgServices: [
35
- (0, graphile_settings_1.makePgService)({ connectionString, schemas: [schemaname] }),
37
+ (0, graphile_settings_1.makePgService)({ pool, schemas: [schemaname] }),
36
38
  ],
37
39
  grafserv: {
38
40
  graphqlPath: '/graphql',