graphile-settings 4.0.0 → 4.0.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.
@@ -6,6 +6,14 @@ export const ConflictDetectorPlugin = {
6
6
  build(build) {
7
7
  // Track codecs by their GraphQL name to detect conflicts
8
8
  const codecsByName = new Map();
9
+ // Get configured schemas from pgServices to only check relevant codecs
10
+ const configuredSchemas = new Set();
11
+ const pgServices = build.resolvedPreset?.pgServices ?? [];
12
+ for (const service of pgServices) {
13
+ for (const schema of service.schemas ?? ['public']) {
14
+ configuredSchemas.add(schema);
15
+ }
16
+ }
9
17
  // Iterate through all codecs to find tables
10
18
  for (const codec of Object.values(build.input.pgRegistry.pgCodecs)) {
11
19
  // Skip non-table codecs (those without attributes or anonymous ones)
@@ -15,6 +23,10 @@ export const ConflictDetectorPlugin = {
15
23
  const pgExtensions = codec.extensions?.pg;
16
24
  const schemaName = pgExtensions?.schemaName || 'unknown';
17
25
  const tableName = codec.name;
26
+ // Skip codecs from schemas not in the configured list
27
+ if (configuredSchemas.size > 0 && !configuredSchemas.has(schemaName)) {
28
+ continue;
29
+ }
18
30
  // Get the GraphQL name that would be generated
19
31
  const graphqlName = build.inflection.tableType(codec);
20
32
  const info = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -65,5 +65,5 @@
65
65
  "constructive",
66
66
  "graphql"
67
67
  ],
68
- "gitHead": "b2daeefe49cdefb3d01ea63cf778fb9b847ab5fe"
68
+ "gitHead": "c05d6bd3dfa36690aefe21079042666dfae801a1"
69
69
  }
@@ -9,6 +9,14 @@ exports.ConflictDetectorPlugin = {
9
9
  build(build) {
10
10
  // Track codecs by their GraphQL name to detect conflicts
11
11
  const codecsByName = new Map();
12
+ // Get configured schemas from pgServices to only check relevant codecs
13
+ const configuredSchemas = new Set();
14
+ const pgServices = build.resolvedPreset?.pgServices ?? [];
15
+ for (const service of pgServices) {
16
+ for (const schema of service.schemas ?? ['public']) {
17
+ configuredSchemas.add(schema);
18
+ }
19
+ }
12
20
  // Iterate through all codecs to find tables
13
21
  for (const codec of Object.values(build.input.pgRegistry.pgCodecs)) {
14
22
  // Skip non-table codecs (those without attributes or anonymous ones)
@@ -18,6 +26,10 @@ exports.ConflictDetectorPlugin = {
18
26
  const pgExtensions = codec.extensions?.pg;
19
27
  const schemaName = pgExtensions?.schemaName || 'unknown';
20
28
  const tableName = codec.name;
29
+ // Skip codecs from schemas not in the configured list
30
+ if (configuredSchemas.size > 0 && !configuredSchemas.has(schemaName)) {
31
+ continue;
32
+ }
21
33
  // Get the GraphQL name that would be generated
22
34
  const graphqlName = build.inflection.tableType(codec);
23
35
  const info = {