graphile-settings 6.21.8 → 6.22.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
@@ -183,6 +183,56 @@ const { schema } = await makeSchema(preset);
183
183
  const sdl = printSchema(schema);
184
184
  ```
185
185
 
186
+ ## Opt-in Scoped Introspection
187
+
188
+ `ConstructivePreset` and `makePgService` retain PostGraphile's upstream
189
+ introspection behavior. Applications that explicitly opt into schema-scoped
190
+ introspection add the independently owned replacement preset and configure the
191
+ service by name in the Graphile gather options:
192
+
193
+ ```typescript
194
+ import { ScopedIntrospectionPreset } from 'graphile-scoped-introspection';
195
+ import { ConstructivePreset, makePgService } from 'graphile-settings';
196
+
197
+ const preset = {
198
+ extends: [ConstructivePreset, ScopedIntrospectionPreset],
199
+ gather: {
200
+ pgScopedIntrospection: {
201
+ main: true,
202
+ },
203
+ },
204
+ pgServices: [
205
+ makePgService({
206
+ connectionString: 'postgres://user:pass@localhost/mydb',
207
+ schemas: ['app_public'],
208
+ }),
209
+ ],
210
+ };
211
+ ```
212
+
213
+ Use an options object when a service needs a specific catalog policy or
214
+ extension capability:
215
+
216
+ ```typescript
217
+ const preset = {
218
+ extends: [ConstructivePreset, ScopedIntrospectionPreset],
219
+ gather: {
220
+ pgScopedIntrospection: {
221
+ main: {
222
+ catalogTypes: 'dependency-closure',
223
+ capabilityExtensions: ['pg_trgm'],
224
+ },
225
+ },
226
+ },
227
+ };
228
+ ```
229
+
230
+ The map is keyed by the final PostgreSQL service name. `true` enables scoped
231
+ defaults, `false` keeps stock introspection, and an omitted service keeps stock
232
+ introspection. The Constructive GraphQL server accepts the same gather options
233
+ under `graphile.preset.gather` and loads the scoped package only when the map is
234
+ configured, unless the replacement preset is already included in `graphile.extends`.
235
+
186
236
  ## Smart Tags Reference
187
237
 
188
238
  Control schema generation with PostgreSQL comments:
@@ -20,9 +20,10 @@
20
20
  * ENV VARS (S3 connection only):
21
21
  * BUCKET_PROVIDER - 'minio' | 's3' (default: 'minio')
22
22
  * AWS_REGION - AWS region (default: 'us-east-1')
23
- * AWS_ACCESS_KEY - access key (default: 'minioadmin')
24
- * AWS_SECRET_KEY - secret key (default: 'minioadmin')
25
- * CDN_ENDPOINT - S3-compatible endpoint (default: 'http://localhost:9000')
23
+ * Defaults come from `pgpmDefaults.cdn` (dev-only values; set these in production).
24
+ * AWS_ACCESS_KEY - access key
25
+ * AWS_SECRET_KEY - secret key
26
+ * CDN_ENDPOINT - S3-compatible endpoint
26
27
  */
27
28
  import type { UploadFieldDefinition } from 'graphile-upload-plugin';
28
29
  /**
@@ -20,9 +20,10 @@
20
20
  * ENV VARS (S3 connection only):
21
21
  * BUCKET_PROVIDER - 'minio' | 's3' (default: 'minio')
22
22
  * AWS_REGION - AWS region (default: 'us-east-1')
23
- * AWS_ACCESS_KEY - access key (default: 'minioadmin')
24
- * AWS_SECRET_KEY - secret key (default: 'minioadmin')
25
- * CDN_ENDPOINT - S3-compatible endpoint (default: 'http://localhost:9000')
23
+ * Defaults come from `pgpmDefaults.cdn` (dev-only values; set these in production).
24
+ * AWS_ACCESS_KEY - access key
25
+ * AWS_SECRET_KEY - secret key
26
+ * CDN_ENDPOINT - S3-compatible endpoint
26
27
  */
27
28
  import { getEnvOptions } from '@constructive-io/graphql-env';
28
29
  import Streamer from '@constructive-io/s3-streamer';
@@ -45,18 +46,18 @@ let streamer = null;
45
46
  function getStreamer() {
46
47
  if (streamer)
47
48
  return streamer;
48
- const { cdn = {} } = getEnvOptions();
49
+ const { cdn } = getEnvOptions();
49
50
  if (process.env.NODE_ENV === 'production' && (!cdn.awsAccessKey || !cdn.awsSecretKey)) {
50
- log.warn('[upload-resolver] WARNING: Using default credentials in production.');
51
+ log.warn('[upload-resolver] WARNING: CDN credentials not configured in production.');
51
52
  }
52
- const provider = cdn.provider || 'minio';
53
+ const provider = cdn.provider;
53
54
  log.info(`[upload-resolver] Initializing: provider=${provider}`);
54
55
  streamer = new Streamer({
55
56
  provider,
56
- awsRegion: cdn.awsRegion || 'us-east-1',
57
- awsAccessKey: cdn.awsAccessKey || 'minioadmin',
58
- awsSecretKey: cdn.awsSecretKey || 'minioadmin',
59
- endpoint: cdn.endpoint || 'http://localhost:9000',
57
+ awsRegion: cdn.awsRegion,
58
+ awsAccessKey: cdn.awsAccessKey,
59
+ awsSecretKey: cdn.awsSecretKey,
60
+ endpoint: cdn.endpoint,
60
61
  });
61
62
  return streamer;
62
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "6.21.8",
3
+ "version": "6.22.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -30,38 +30,38 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@aws-sdk/client-s3": "^3.1052.0",
33
- "@constructive-io/bucket-provisioner": "^0.28.0",
34
- "@constructive-io/graphql-env": "^3.32.1",
35
- "@constructive-io/graphql-types": "^3.31.1",
36
- "@constructive-io/s3-streamer": "^2.42.5",
37
- "@constructive-io/s3-utils": "^2.33.0",
33
+ "@constructive-io/bucket-provisioner": "^0.28.1",
34
+ "@constructive-io/graphql-env": "^3.33.0",
35
+ "@constructive-io/graphql-types": "^3.32.0",
36
+ "@constructive-io/s3-streamer": "^2.43.0",
37
+ "@constructive-io/s3-utils": "^2.33.1",
38
38
  "@constructive-io/upload-names": "^2.30.1",
39
39
  "@dataplan/json": "1.0.1",
40
40
  "@dataplan/pg": "1.1.1",
41
41
  "@graphile-contrib/pg-many-to-many": "2.0.0-rc.2",
42
42
  "@pgpmjs/logger": "^2.25.1",
43
- "@pgpmjs/types": "^2.53.3",
43
+ "@pgpmjs/types": "^2.54.0",
44
44
  "@pgsql/quotes": "^18.2.4",
45
45
  "cors": "^2.8.6",
46
46
  "express": "^5.2.1",
47
47
  "grafast": "1.1.2",
48
48
  "grafserv": "1.0.1",
49
- "graphile-bucket-provisioner-plugin": "1.15.2",
49
+ "graphile-bucket-provisioner-plugin": "1.15.3",
50
50
  "graphile-build": "5.1.1",
51
51
  "graphile-build-pg": "5.1.3",
52
- "graphile-bulk-mutations": "^1.14.6",
52
+ "graphile-bulk-mutations": "^1.15.0",
53
53
  "graphile-config": "1.1.0",
54
- "graphile-connection-filter": "^2.14.6",
55
- "graphile-history": "^1.6.6",
56
- "graphile-i18n": "^2.15.1",
57
- "graphile-llm": "^1.15.8",
58
- "graphile-ltree": "^2.14.6",
54
+ "graphile-connection-filter": "^2.15.0",
55
+ "graphile-history": "^1.7.0",
56
+ "graphile-i18n": "^2.16.0",
57
+ "graphile-llm": "^1.16.0",
58
+ "graphile-ltree": "^2.15.0",
59
59
  "graphile-meta": "^1.9.2",
60
- "graphile-pg-aggregates": "^2.14.6",
61
- "graphile-postgis": "^3.15.6",
62
- "graphile-presigned-url-plugin": "^1.19.0",
60
+ "graphile-pg-aggregates": "^2.15.0",
61
+ "graphile-postgis": "^3.16.0",
62
+ "graphile-presigned-url-plugin": "^1.19.1",
63
63
  "graphile-realtime-subscriptions": "^1.11.1",
64
- "graphile-search": "^2.14.6",
64
+ "graphile-search": "^2.15.0",
65
65
  "graphile-upload-plugin": "^2.26.1",
66
66
  "graphile-utils": "5.0.3",
67
67
  "graphql": "16.13.0",
@@ -80,7 +80,7 @@
80
80
  "@types/express": "^5.0.6",
81
81
  "@types/pg": "^8.20.4",
82
82
  "@types/request-ip": "^0.0.41",
83
- "graphile-test": "^5.14.6",
83
+ "graphile-test": "^5.15.0",
84
84
  "makage": "^0.8.0",
85
85
  "nodemon": "^3.1.14",
86
86
  "ts-node": "^10.9.2"
@@ -92,5 +92,5 @@
92
92
  "constructive",
93
93
  "graphql"
94
94
  ],
95
- "gitHead": "27be33dc1ba8351e2a2c2bbb99b9c0798c0813b9"
95
+ "gitHead": "399437801c27b070312125f3f0ee821ce16e183e"
96
96
  }
@@ -20,9 +20,10 @@
20
20
  * ENV VARS (S3 connection only):
21
21
  * BUCKET_PROVIDER - 'minio' | 's3' (default: 'minio')
22
22
  * AWS_REGION - AWS region (default: 'us-east-1')
23
- * AWS_ACCESS_KEY - access key (default: 'minioadmin')
24
- * AWS_SECRET_KEY - secret key (default: 'minioadmin')
25
- * CDN_ENDPOINT - S3-compatible endpoint (default: 'http://localhost:9000')
23
+ * Defaults come from `pgpmDefaults.cdn` (dev-only values; set these in production).
24
+ * AWS_ACCESS_KEY - access key
25
+ * AWS_SECRET_KEY - secret key
26
+ * CDN_ENDPOINT - S3-compatible endpoint
26
27
  */
27
28
  import type { UploadFieldDefinition } from 'graphile-upload-plugin';
28
29
  /**
@@ -21,9 +21,10 @@
21
21
  * ENV VARS (S3 connection only):
22
22
  * BUCKET_PROVIDER - 'minio' | 's3' (default: 'minio')
23
23
  * AWS_REGION - AWS region (default: 'us-east-1')
24
- * AWS_ACCESS_KEY - access key (default: 'minioadmin')
25
- * AWS_SECRET_KEY - secret key (default: 'minioadmin')
26
- * CDN_ENDPOINT - S3-compatible endpoint (default: 'http://localhost:9000')
24
+ * Defaults come from `pgpmDefaults.cdn` (dev-only values; set these in production).
25
+ * AWS_ACCESS_KEY - access key
26
+ * AWS_SECRET_KEY - secret key
27
+ * CDN_ENDPOINT - S3-compatible endpoint
27
28
  */
28
29
  var __importDefault = (this && this.__importDefault) || function (mod) {
29
30
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -51,18 +52,18 @@ let streamer = null;
51
52
  function getStreamer() {
52
53
  if (streamer)
53
54
  return streamer;
54
- const { cdn = {} } = (0, graphql_env_1.getEnvOptions)();
55
+ const { cdn } = (0, graphql_env_1.getEnvOptions)();
55
56
  if (process.env.NODE_ENV === 'production' && (!cdn.awsAccessKey || !cdn.awsSecretKey)) {
56
- log.warn('[upload-resolver] WARNING: Using default credentials in production.');
57
+ log.warn('[upload-resolver] WARNING: CDN credentials not configured in production.');
57
58
  }
58
- const provider = cdn.provider || 'minio';
59
+ const provider = cdn.provider;
59
60
  log.info(`[upload-resolver] Initializing: provider=${provider}`);
60
61
  streamer = new s3_streamer_1.default({
61
62
  provider,
62
- awsRegion: cdn.awsRegion || 'us-east-1',
63
- awsAccessKey: cdn.awsAccessKey || 'minioadmin',
64
- awsSecretKey: cdn.awsSecretKey || 'minioadmin',
65
- endpoint: cdn.endpoint || 'http://localhost:9000',
63
+ awsRegion: cdn.awsRegion,
64
+ awsAccessKey: cdn.awsAccessKey,
65
+ awsSecretKey: cdn.awsSecretKey,
66
+ endpoint: cdn.endpoint,
66
67
  });
67
68
  return streamer;
68
69
  }