graphile-settings 4.0.0 → 4.1.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.
|
@@ -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.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "graphile settings",
|
|
6
6
|
"main": "index.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"build": "makage build",
|
|
26
26
|
"build:dev": "makage build --dev",
|
|
27
27
|
"lint": "eslint . --fix",
|
|
28
|
-
"test": "jest
|
|
28
|
+
"test": "jest",
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@constructive-io/graphql-env": "^3.
|
|
32
|
+
"@constructive-io/graphql-env": "^3.1.0",
|
|
33
33
|
"@constructive-io/graphql-types": "^3.0.0",
|
|
34
34
|
"@graphile-contrib/pg-many-to-many": "2.0.0-rc.1",
|
|
35
35
|
"@pgpmjs/types": "^2.16.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"graphile-build": "^5.0.0-rc.3",
|
|
40
40
|
"graphile-build-pg": "^5.0.0-rc.3",
|
|
41
41
|
"graphile-config": "1.0.0-rc.3",
|
|
42
|
-
"graphile-search-plugin": "^3.
|
|
42
|
+
"graphile-search-plugin": "^3.1.0",
|
|
43
43
|
"graphql": "^16.9.0",
|
|
44
44
|
"inflekt": "^0.3.0",
|
|
45
45
|
"lru-cache": "^11.2.4",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"constructive",
|
|
66
66
|
"graphql"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "6dac0247c675de94b41038ac1e5095dc5df0c753"
|
|
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 = {
|