@graphql-mesh/fusion-composition 0.7.18-alpha-20250113163059-155c501f0a4aa0c19f4ab3c446a84711ac3aedf2 → 0.7.18-alpha-20250114132955-421a6fb1e8f6e837876e524a1ab664bf374ea9e6
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/cjs/federation-utils.js +15 -1
- package/esm/federation-utils.js +15 -1
- package/package.json +2 -2
package/cjs/federation-utils.js
CHANGED
|
@@ -85,6 +85,19 @@ const FEDERATION_V1_DIRECTIVES = [
|
|
|
85
85
|
];
|
|
86
86
|
function detectAndAddMeshDirectives(subgraph) {
|
|
87
87
|
const meshDirectives = [];
|
|
88
|
+
const existingAdditionalDirectives = [];
|
|
89
|
+
const existingDirectiveExtensionsOnSchema = (0, utils_1.getDirectiveExtensions)(subgraph);
|
|
90
|
+
if (existingDirectiveExtensionsOnSchema?.link) {
|
|
91
|
+
const linkDirectives = existingDirectiveExtensionsOnSchema.link;
|
|
92
|
+
for (const linkDirective of linkDirectives) {
|
|
93
|
+
if (linkDirective.url != null &&
|
|
94
|
+
!linkDirective.url.startsWith('https://the-guild.dev/graphql/mesh/spec/')) {
|
|
95
|
+
if (linkDirective.import) {
|
|
96
|
+
existingAdditionalDirectives.push(...linkDirective.import);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
88
101
|
subgraph = (0, utils_1.mapSchema)(subgraph, {
|
|
89
102
|
[utils_1.MapperKind.DIRECTIVE]: directive => {
|
|
90
103
|
const directiveName = `@${directive.name}`;
|
|
@@ -92,7 +105,8 @@ function detectAndAddMeshDirectives(subgraph) {
|
|
|
92
105
|
!FEDERATION_V1_DIRECTIVES.includes(directiveName) &&
|
|
93
106
|
!directiveName.startsWith('@federation__') &&
|
|
94
107
|
directiveName !== '@stream' &&
|
|
95
|
-
directiveName !== '@link'
|
|
108
|
+
directiveName !== '@link' &&
|
|
109
|
+
!existingAdditionalDirectives.includes(directiveName)) {
|
|
96
110
|
meshDirectives.push(directiveName);
|
|
97
111
|
if (!directive.isRepeatable && directive.args.some(arg => arg.name === 'subgraph')) {
|
|
98
112
|
return new graphql_1.GraphQLDirective({
|
package/esm/federation-utils.js
CHANGED
|
@@ -77,6 +77,19 @@ const FEDERATION_V1_DIRECTIVES = [
|
|
|
77
77
|
];
|
|
78
78
|
export function detectAndAddMeshDirectives(subgraph) {
|
|
79
79
|
const meshDirectives = [];
|
|
80
|
+
const existingAdditionalDirectives = [];
|
|
81
|
+
const existingDirectiveExtensionsOnSchema = getDirectiveExtensions(subgraph);
|
|
82
|
+
if (existingDirectiveExtensionsOnSchema?.link) {
|
|
83
|
+
const linkDirectives = existingDirectiveExtensionsOnSchema.link;
|
|
84
|
+
for (const linkDirective of linkDirectives) {
|
|
85
|
+
if (linkDirective.url != null &&
|
|
86
|
+
!linkDirective.url.startsWith('https://the-guild.dev/graphql/mesh/spec/')) {
|
|
87
|
+
if (linkDirective.import) {
|
|
88
|
+
existingAdditionalDirectives.push(...linkDirective.import);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
80
93
|
subgraph = mapSchema(subgraph, {
|
|
81
94
|
[MapperKind.DIRECTIVE]: directive => {
|
|
82
95
|
const directiveName = `@${directive.name}`;
|
|
@@ -84,7 +97,8 @@ export function detectAndAddMeshDirectives(subgraph) {
|
|
|
84
97
|
!FEDERATION_V1_DIRECTIVES.includes(directiveName) &&
|
|
85
98
|
!directiveName.startsWith('@federation__') &&
|
|
86
99
|
directiveName !== '@stream' &&
|
|
87
|
-
directiveName !== '@link'
|
|
100
|
+
directiveName !== '@link' &&
|
|
101
|
+
!existingAdditionalDirectives.includes(directiveName)) {
|
|
88
102
|
meshDirectives.push(directiveName);
|
|
89
103
|
if (!directive.isRepeatable && directive.args.some(arg => arg.name === 'subgraph')) {
|
|
90
104
|
return new GraphQLDirective({
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/fusion-composition",
|
|
3
|
-
"version": "0.7.18-alpha-
|
|
3
|
+
"version": "0.7.18-alpha-20250114132955-421a6fb1e8f6e837876e524a1ab664bf374ea9e6",
|
|
4
4
|
"description": "Basic composition utility for Fusion spec",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-mesh/utils": "0.103.
|
|
10
|
+
"@graphql-mesh/utils": "^0.103.11",
|
|
11
11
|
"@graphql-tools/schema": "^10.0.5",
|
|
12
12
|
"@graphql-tools/stitching-directives": "^3.1.9",
|
|
13
13
|
"@graphql-tools/utils": "^10.6.0",
|