Skip to content

Commit 70269cd

Browse files
authored
fix: accept fed 2.7 supergraphs (#590)
1 parent a700e28 commit 70269cd

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

packages/compatibility/src/composeSupergraph.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { readFile, writeFile } from 'fs/promises';
88
import { createWriteStream } from 'fs';
99

1010
const COMPOSITION_VERSION =
11-
process.env['APOLLO_ROVER_DEV_COMPOSITION_VERSION'] ?? '2.5.5';
11+
process.env['APOLLO_ROVER_DEV_COMPOSITION_VERSION'] ?? '2.7.1';
1212
const ROUTER_VERSION =
13-
process.env['APOLLO_ROVER_DEV_ROUTER_VERSION'] ?? '1.30.1';
13+
process.env['APOLLO_ROVER_DEV_ROUTER_VERSION'] ?? '1.39.0';
1414
const roverDebug = debug('rover');
1515

1616
/**

packages/compatibility/src/tests/link.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,32 @@ test('@link', async () => {
3232
fedLinkCount++;
3333

3434
const federationVersion = linkUrl.match(linkUrlSpecVersionRegex)[1];
35-
// only federation v2.0 and v2.1 are supported
36-
expect(federationVersion).toMatch(/2\.0|2\.1|2\.2|2\.3|2\.4|2\.5/);
35+
// federation v2.0 through v2.7 are supported
36+
expect(federationVersion).toMatch(
37+
/2\.0|2\.1|2\.2|2\.3|2\.4|2\.5|2\.6|2\.7/,
38+
);
3739

3840
const linkImportsRegex = /import:\[(.+?)\]/;
3941
if (linkImportsRegex.test(element)) {
4042
// verify federation imports
4143
const expected = [
44+
'@authenticated',
4245
'@composeDirective',
4346
'@extends',
4447
'@external',
4548
'@inaccessible',
4649
'@interfaceObject',
4750
'@key',
4851
'@override',
52+
'@policy',
4953
'@provides',
5054
'@requires',
55+
'@requiresScopes',
5156
'@shareable',
5257
'@tag',
5358
'FieldSet',
59+
'Scope',
60+
'Policy',
5461
];
5562

5663
const linkImportsMatch = element.match(linkImportsRegex);

packages/compatibility/supergraph-compose.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
router:
3-
image: ghcr.io/apollographql/router:v1.30.1
3+
image: ghcr.io/apollographql/router:v1.39.0
44
volumes:
55
- ${SCRIPT_DIR}/router.yaml:/dist/config/router.yaml
66
- ./supergraph.graphql:/dist/config/supergraph.graphql

0 commit comments

Comments
 (0)