@graphql-mesh/fusion-composition 0.8.12-alpha-20250811123610-8aec49c267f74542b51b72d4f16ee9ad6ed7d526 → 0.8.12-alpha-20250811205722-c32e1a3cd4141c609fedbd0f6c0d633fc00c2f53

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.
@@ -38,9 +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
- const federationVersion = importStatement.url.match(/v(\d+\.\d+)/)?.[1];
42
- if (federationVersion && federationVersion.startsWith('2.')) {
43
- 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
+ }
44
49
  }
45
50
  importStatement.import = [...new Set([...(importStatement.import || []), ...directives])];
46
51
  const extensions = (subgraph.extensions ||= {});
@@ -30,9 +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
- const federationVersion = importStatement.url.match(/v(\d+\.\d+)/)?.[1];
34
- if (federationVersion && federationVersion.startsWith('2.')) {
35
- 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
+ }
36
41
  }
37
42
  importStatement.import = [...new Set([...(importStatement.import || []), ...directives])];
38
43
  const extensions = (subgraph.extensions ||= {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-mesh/fusion-composition",
3
- "version": "0.8.12-alpha-20250811123610-8aec49c267f74542b51b72d4f16ee9ad6ed7d526",
3
+ "version": "0.8.12-alpha-20250811205722-c32e1a3cd4141c609fedbd0f6c0d633fc00c2f53",
4
4
  "description": "Basic composition utility for Fusion spec",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {