@graphql-mesh/fusion-composition 0.8.11 → 0.8.12-alpha-20250811121914-a277abf12c16ed2cc8da9ca91833bae7c29ff511

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,7 +38,8 @@ 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') {
41
+ const federationVersion = importStatement.url.match(/v(\d+\.\d+)/)?.[1];
42
+ if (federationVersion && federationVersion.startsWith('2.0')) {
42
43
  importStatement.url = 'https://specs.apollo.dev/federation/v2.6';
43
44
  }
44
45
  importStatement.import = [...new Set([...(importStatement.import || []), ...directives])];
@@ -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,7 +30,8 @@ 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') {
33
+ const federationVersion = importStatement.url.match(/v(\d+\.\d+)/)?.[1];
34
+ if (federationVersion && federationVersion.startsWith('2.0')) {
34
35
  importStatement.url = 'https://specs.apollo.dev/federation/v2.6';
35
36
  }
36
37
  importStatement.import = [...new Set([...(importStatement.import || []), ...directives])];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-mesh/fusion-composition",
3
- "version": "0.8.11",
3
+ "version": "0.8.12-alpha-20250811121914-a277abf12c16ed2cc8da9ca91833bae7c29ff511",
4
4
  "description": "Basic composition utility for Fusion spec",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {