graphile-settings 6.0.6 → 6.1.3

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.
@@ -14,6 +14,21 @@ import { getBucketProvisionerConnection } from '../bucket-provisioner-resolver';
14
14
  import { ConflictDetectorPreset, EnableAllFilterColumnsPreset, InflectorLoggerPreset, InflektPreset, ManyToManyOptInPreset, MetaSchemaPreset, MinimalPreset, NoUniqueLookupPreset, PgTypeMappingsPreset, RequiredInputPreset } from '../plugins';
15
15
  import { createBucketNameResolver, createEnsureBucketProvisioned, getAllowedOrigins, getPresignedUrlS3Config } from '../presigned-url-resolver';
16
16
  import { constructiveUploadFieldDefinitions } from '../upload-resolver';
17
+ /**
18
+ * grafast / @dataplan/pg require Node >= 22 (they call Promise.withResolvers()
19
+ * in their execution paths). On older Node versions there is no fail-fast:
20
+ * every connection (list) query fails at runtime with
21
+ * `TypeError: Cannot read properties of undefined (reading 'items')` inside
22
+ * grafast's ConnectionStep while mutations keep working. Guard here so any
23
+ * schema built from the Constructive preset fails loudly instead.
24
+ */
25
+ function assertSupportedNodeVersion() {
26
+ if (typeof Promise.withResolvers !== 'function') {
27
+ throw new Error(`graphile-settings requires Node.js >= 22 (found ${process.version}): ` +
28
+ 'grafast/@dataplan/pg depend on Promise.withResolvers(). On older Node versions ' +
29
+ "connection (list) queries fail at runtime with \"Cannot read properties of undefined (reading 'items')\".");
30
+ }
31
+ }
17
32
  const DEFAULTS = {
18
33
  enableAggregates: false,
19
34
  enablePostgis: true,
@@ -84,6 +99,7 @@ const DEFAULTS = {
84
99
  * ```
85
100
  */
86
101
  export function createConstructivePreset(options) {
102
+ assertSupportedNodeVersion();
87
103
  const opts = { ...DEFAULTS, ...options };
88
104
  // ----- extends array -----
89
105
  const presets = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "6.0.6",
3
+ "version": "6.1.3",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -30,43 +30,43 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@aws-sdk/client-s3": "^3.1052.0",
33
- "@constructive-io/bucket-provisioner": "^0.14.0",
34
- "@constructive-io/graphql-env": "^3.17.1",
35
- "@constructive-io/graphql-types": "^3.16.1",
36
- "@constructive-io/s3-streamer": "^2.29.3",
37
- "@constructive-io/s3-utils": "^2.20.0",
38
- "@constructive-io/upload-names": "^2.19.0",
33
+ "@constructive-io/bucket-provisioner": "^0.15.2",
34
+ "@constructive-io/graphql-env": "^3.19.2",
35
+ "@constructive-io/graphql-types": "^3.18.2",
36
+ "@constructive-io/s3-streamer": "^2.30.2",
37
+ "@constructive-io/s3-utils": "^2.21.2",
38
+ "@constructive-io/upload-names": "^2.20.2",
39
39
  "@dataplan/json": "1.0.0",
40
40
  "@dataplan/pg": "1.0.3",
41
41
  "@graphile-contrib/pg-many-to-many": "2.0.0-rc.2",
42
- "@pgpmjs/logger": "^2.14.0",
43
- "@pgpmjs/types": "^2.36.0",
42
+ "@pgpmjs/logger": "^2.15.2",
43
+ "@pgpmjs/types": "^2.37.2",
44
44
  "@pgsql/quotes": "^18.1.0",
45
45
  "cors": "^2.8.6",
46
46
  "express": "^5.2.1",
47
47
  "grafast": "1.0.2",
48
48
  "grafserv": "1.0.0",
49
- "graphile-bucket-provisioner-plugin": "1.0.0",
49
+ "graphile-bucket-provisioner-plugin": "1.1.2",
50
50
  "graphile-build": "5.0.2",
51
51
  "graphile-build-pg": "5.0.2",
52
- "graphile-bulk-mutations": "^1.0.6",
52
+ "graphile-bulk-mutations": "^1.1.2",
53
53
  "graphile-config": "1.0.1",
54
- "graphile-connection-filter": "^2.0.6",
55
- "graphile-i18n": "^2.0.6",
56
- "graphile-llm": "^1.0.6",
57
- "graphile-ltree": "^2.0.6",
58
- "graphile-pg-aggregates": "^2.0.6",
59
- "graphile-postgis": "^3.0.6",
60
- "graphile-presigned-url-plugin": "^1.0.0",
61
- "graphile-realtime-subscriptions": "^1.0.0",
62
- "graphile-search": "^2.0.6",
63
- "graphile-upload-plugin": "^2.14.0",
54
+ "graphile-connection-filter": "^2.1.2",
55
+ "graphile-i18n": "^2.1.2",
56
+ "graphile-llm": "^1.1.2",
57
+ "graphile-ltree": "^2.1.2",
58
+ "graphile-pg-aggregates": "^2.1.2",
59
+ "graphile-postgis": "^3.1.2",
60
+ "graphile-presigned-url-plugin": "^1.1.2",
61
+ "graphile-realtime-subscriptions": "^1.1.2",
62
+ "graphile-search": "^2.1.2",
63
+ "graphile-upload-plugin": "^2.15.2",
64
64
  "graphile-utils": "5.0.1",
65
65
  "graphql": "16.13.0",
66
66
  "inflekt": "^0.7.1",
67
67
  "lru-cache": "^11.2.7",
68
68
  "pg": "^8.21.0",
69
- "pg-query-context": "^2.19.0",
69
+ "pg-query-context": "^2.20.2",
70
70
  "pg-sql2": "5.0.1",
71
71
  "postgraphile": "5.0.3",
72
72
  "request-ip": "^3.3.0",
@@ -77,7 +77,7 @@
77
77
  "@types/express": "^5.0.6",
78
78
  "@types/pg": "^8.20.0",
79
79
  "@types/request-ip": "^0.0.41",
80
- "graphile-test": "^5.0.6",
80
+ "graphile-test": "^5.1.2",
81
81
  "makage": "^0.3.0",
82
82
  "nodemon": "^3.1.14",
83
83
  "ts-node": "^10.9.2"
@@ -89,5 +89,5 @@
89
89
  "constructive",
90
90
  "graphql"
91
91
  ],
92
- "gitHead": "ebba3f838664032e6f6adf6c9c6d2b6cdddd994a"
92
+ "gitHead": "0e3ee42c44c9b35ffac4bf1faa6775eb69311ec4"
93
93
  }
@@ -18,6 +18,21 @@ const bucket_provisioner_resolver_1 = require("../bucket-provisioner-resolver");
18
18
  const plugins_1 = require("../plugins");
19
19
  const presigned_url_resolver_1 = require("../presigned-url-resolver");
20
20
  const upload_resolver_1 = require("../upload-resolver");
21
+ /**
22
+ * grafast / @dataplan/pg require Node >= 22 (they call Promise.withResolvers()
23
+ * in their execution paths). On older Node versions there is no fail-fast:
24
+ * every connection (list) query fails at runtime with
25
+ * `TypeError: Cannot read properties of undefined (reading 'items')` inside
26
+ * grafast's ConnectionStep while mutations keep working. Guard here so any
27
+ * schema built from the Constructive preset fails loudly instead.
28
+ */
29
+ function assertSupportedNodeVersion() {
30
+ if (typeof Promise.withResolvers !== 'function') {
31
+ throw new Error(`graphile-settings requires Node.js >= 22 (found ${process.version}): ` +
32
+ 'grafast/@dataplan/pg depend on Promise.withResolvers(). On older Node versions ' +
33
+ "connection (list) queries fail at runtime with \"Cannot read properties of undefined (reading 'items')\".");
34
+ }
35
+ }
21
36
  const DEFAULTS = {
22
37
  enableAggregates: false,
23
38
  enablePostgis: true,
@@ -88,6 +103,7 @@ const DEFAULTS = {
88
103
  * ```
89
104
  */
90
105
  function createConstructivePreset(options) {
106
+ assertSupportedNodeVersion();
91
107
  const opts = { ...DEFAULTS, ...options };
92
108
  // ----- extends array -----
93
109
  const presets = [