graphile-settings 6.1.2 → 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.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "graphile settings",
|
|
6
6
|
"main": "index.js",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"constructive",
|
|
90
90
|
"graphql"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
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 = [
|