@graphql-mesh/fusion-composition 0.8.12-alpha-20250825140658-988f735d5b841746038b8f3fd125b97353823c82 → 0.8.12-alpha-20250825194359-2dad83d9f4595fc4f0f7b4e29044dcb440fab4c8

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.
@@ -18,7 +18,7 @@ function addFederation2DirectivesToSubgraph(subgraph) {
18
18
  }
19
19
  if (!linkDirectives.some(linkDirectiveArgs => linkDirectiveArgs.url?.startsWith('https://specs.apollo.dev/federation/'))) {
20
20
  linkDirectives.push({
21
- url: 'https://specs.apollo.dev/federation/v2.3',
21
+ url: 'https://specs.apollo.dev/federation/v2.6',
22
22
  import: [],
23
23
  });
24
24
  }
@@ -38,8 +38,14 @@ function importFederationDirectives(subgraph, directives) {
38
38
  linkDirectives.push(importStatement);
39
39
  }
40
40
  // v2.0 is not supported so bump to v2.6
41
- if (importStatement.url === 'https://specs.apollo.dev/federation/v2.0') {
42
- importStatement.url = 'https://specs.apollo.dev/federation/v2.6';
41
+ const match = importStatement.url.match(/\/v(\d+)\.(\d+)(?:$|\/)/);
42
+ if (match) {
43
+ const major = Number(match[1]);
44
+ const minor = Number(match[2]);
45
+ // Bump only older 2.x (2.0–2.5) to v2.6, leave >=2.6 as-is
46
+ if (major === 2 && minor < 6) {
47
+ importStatement.url = 'https://specs.apollo.dev/federation/v2.6';
48
+ }
43
49
  }
44
50
  importStatement.import = [...new Set([...(importStatement.import || []), ...directives])];
45
51
  const extensions = (subgraph.extensions ||= {});
@@ -10,7 +10,7 @@ export function addFederation2DirectivesToSubgraph(subgraph) {
10
10
  }
11
11
  if (!linkDirectives.some(linkDirectiveArgs => linkDirectiveArgs.url?.startsWith('https://specs.apollo.dev/federation/'))) {
12
12
  linkDirectives.push({
13
- url: 'https://specs.apollo.dev/federation/v2.3',
13
+ url: 'https://specs.apollo.dev/federation/v2.6',
14
14
  import: [],
15
15
  });
16
16
  }
@@ -30,8 +30,14 @@ export function importFederationDirectives(subgraph, directives) {
30
30
  linkDirectives.push(importStatement);
31
31
  }
32
32
  // v2.0 is not supported so bump to v2.6
33
- if (importStatement.url === 'https://specs.apollo.dev/federation/v2.0') {
34
- importStatement.url = 'https://specs.apollo.dev/federation/v2.6';
33
+ const match = importStatement.url.match(/\/v(\d+)\.(\d+)(?:$|\/)/);
34
+ if (match) {
35
+ const major = Number(match[1]);
36
+ const minor = Number(match[2]);
37
+ // Bump only older 2.x (2.0–2.5) to v2.6, leave >=2.6 as-is
38
+ if (major === 2 && minor < 6) {
39
+ importStatement.url = 'https://specs.apollo.dev/federation/v2.6';
40
+ }
35
41
  }
36
42
  importStatement.import = [...new Set([...(importStatement.import || []), ...directives])];
37
43
  const extensions = (subgraph.extensions ||= {});
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@graphql-mesh/fusion-composition",
3
- "version": "0.8.12-alpha-20250825140658-988f735d5b841746038b8f3fd125b97353823c82",
3
+ "version": "0.8.12-alpha-20250825194359-2dad83d9f4595fc4f0f7b4e29044dcb440fab4c8",
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.104.8-alpha-20250825140658-988f735d5b841746038b8f3fd125b97353823c82",
10
+ "@graphql-mesh/utils": "^0.104.7",
11
11
  "@graphql-tools/schema": "^10.0.5",
12
12
  "@graphql-tools/stitching-directives": "^3.1.9",
13
13
  "@graphql-tools/utils": "^10.8.0",