Skip to content

Commit

Permalink
Update to 2.10 (#3117)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-apollo authored Aug 14, 2024
1 parent 14ecd7a commit d72d138
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 40 deletions.
20 changes: 11 additions & 9 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"mode": "pre",
"tag": "connectors",
"tag": "alpha",
"initialVersions": {
"@apollo/composition": "2.9.0-connectors.8",
"apollo-federation-integration-testsuite": "2.9.0-connectors.8",
"@apollo/gateway": "2.9.0-connectors.8",
"@apollo/federation-internals": "2.9.0-connectors.8",
"@apollo/query-graphs": "2.9.0-connectors.8",
"@apollo/query-planner": "2.9.0-connectors.8",
"@apollo/subgraph": "2.9.0-connectors.8"
"@apollo/composition": "2.9.0",
"apollo-federation-integration-testsuite": "2.9.0",
"@apollo/gateway": "2.9.0",
"@apollo/federation-internals": "2.9.0",
"@apollo/query-graphs": "2.9.0",
"@apollo/query-planner": "2.9.0",
"@apollo/subgraph": "2.9.0"
},
"changesets": []
"changesets": [
"happy-bats-exist"
]
}
6 changes: 3 additions & 3 deletions composition-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/composition",
"version": "2.9.0-connectors.9",
"version": "2.10.0-alpha.0",
"description": "Apollo Federation composition utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -27,8 +27,8 @@
"access": "public"
},
"dependencies": {
"@apollo/federation-internals": "2.9.0-connectors.9",
"@apollo/query-graphs": "2.9.0-connectors.9"
"@apollo/federation-internals": "2.10.0-alpha.0",
"@apollo/query-graphs": "2.10.0-alpha.0"
},
"peerDependencies": {
"graphql": "^16.5.0"
Expand Down
8 changes: 4 additions & 4 deletions composition-js/src/__tests__/connectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("connect spec and join__directive", () => {
typeDefs: parse(`
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.7"
url: "https://specs.apollo.dev/federation/v2.10"
import: ["@key"]
)
@link(
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("connect spec and join__directive", () => {
typeDefs: parse(`
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.7"
url: "https://specs.apollo.dev/federation/v2.10"
import: ["@key"]
)
@link(
Expand Down Expand Up @@ -248,7 +248,7 @@ describe("connect spec and join__directive", () => {
typeDefs: parse(`
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.7"
url: "https://specs.apollo.dev/federation/v2.10"
import: ["@key"]
)
@link(
Expand Down Expand Up @@ -286,7 +286,7 @@ describe("connect spec and join__directive", () => {
typeDefs: parse(`
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.7"
url: "https://specs.apollo.dev/federation/v2.10"
import: ["@key"]
)
@link(
Expand Down
6 changes: 3 additions & 3 deletions composition-js/src/__tests__/hints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ describe('when a directive causes an implicit federation version upgrade', () =>
assertCompositionSuccess(result);
expect(result).toRaiseHint(
HINTS.IMPLICITLY_UPGRADED_FEDERATION_VERSION,
'Subgraph upgraded has been implicitly upgraded from federation v2.5 to v2.9',
'Subgraph upgraded has been implicitly upgraded from federation v2.5 to v2.10',
'@link'
);
});
Expand All @@ -1318,12 +1318,12 @@ describe('when a directive causes an implicit federation version upgrade', () =>
assertCompositionSuccess(result);
expect(result).toRaiseHint(
HINTS.IMPLICITLY_UPGRADED_FEDERATION_VERSION,
'Subgraph upgraded-1 has been implicitly upgraded from federation v2.5 to v2.9',
'Subgraph upgraded-1 has been implicitly upgraded from federation v2.5 to v2.10',
'@link'
);
expect(result).toRaiseHint(
HINTS.IMPLICITLY_UPGRADED_FEDERATION_VERSION,
'Subgraph upgraded-2 has been implicitly upgraded from federation v2.5 to v2.9',
'Subgraph upgraded-2 has been implicitly upgraded from federation v2.5 to v2.10',
'@link'
);
});
Expand Down
2 changes: 1 addition & 1 deletion composition-js/src/merging/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class Merger {
}
}
const impliedFederationVersion = FeatureVersion.max(versionsFromFeatures);
if (!impliedFederationVersion?.satisfies(linkedFederationVersion) || linkedFederationVersion >= impliedFederationVersion) {
if (!impliedFederationVersion?.satisfies(linkedFederationVersion) || linkedFederationVersion.gte(impliedFederationVersion)) {
return linkedFederationVersion;
}

Expand Down
2 changes: 1 addition & 1 deletion federation-integration-testsuite-js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "apollo-federation-integration-testsuite",
"private": true,
"version": "2.9.0-connectors.9",
"version": "2.10.0-alpha.0",
"description": "Apollo Federation Integrations / Test Fixtures",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions gateway-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/gateway",
"version": "2.9.0-connectors.9",
"version": "2.10.0-alpha.0",
"description": "Apollo Gateway",
"author": "Apollo <[email protected]>",
"main": "dist/index.js",
Expand All @@ -25,9 +25,9 @@
"access": "public"
},
"dependencies": {
"@apollo/composition": "2.9.0-connectors.9",
"@apollo/federation-internals": "2.9.0-connectors.9",
"@apollo/query-planner": "2.9.0-connectors.9",
"@apollo/composition": "2.10.0-alpha.0",
"@apollo/federation-internals": "2.10.0-alpha.0",
"@apollo/query-planner": "2.10.0-alpha.0",
"@apollo/server-gateway-interface": "^1.1.0",
"@apollo/usage-reporting-protobuf": "^4.1.0",
"@apollo/utils.createhash": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion internals-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/federation-internals",
"version": "2.9.0-connectors.9",
"version": "2.10.0-alpha.0",
"description": "Apollo Federation internal utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions internals-js/src/federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1815,9 +1815,9 @@ export function setSchemaAsFed2Subgraph(schema: Schema, useLatest: boolean = fal

// This is the full @link declaration as added by `asFed2SubgraphDocument`. It's here primarily for uses by tests that print and match
// subgraph schema to avoid having to update 20+ tests every time we use a new directive or the order of import changes ...
export const FEDERATION2_LINK_WITH_FULL_IMPORTS = '@link(url: "https://specs.apollo.dev/federation/v2.9", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject", "@authenticated", "@requiresScopes", "@policy", "@context", "@fromContext", "@cost", "@listSize"])';
export const FEDERATION2_LINK_WITH_FULL_IMPORTS = '@link(url: "https://specs.apollo.dev/federation/v2.10", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject", "@authenticated", "@requiresScopes", "@policy", "@context", "@fromContext", "@cost", "@listSize"])';
// This is the full @link declaration that is added when upgrading fed v1 subgraphs to v2 version. It should only be used by tests.
export const FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS = '@link(url: "https://specs.apollo.dev/federation/v2.9", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject"])';
export const FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS = '@link(url: "https://specs.apollo.dev/federation/v2.10", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject"])';

// This is the federation @link for tests that go through the SchemaUpgrader.
export const FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS_UPGRADED = '@link(url: "https://specs.apollo.dev/federation/v2.4", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject"])';
Expand Down
2 changes: 1 addition & 1 deletion internals-js/src/specs/connectSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,6 @@ export type ConnectDirectiveHTTP = {
};

export const CONNECT_VERSIONS = new FeatureDefinitions<ConnectSpecDefinition>(connectIdentity)
.add(new ConnectSpecDefinition(new FeatureVersion(0, 1), new FeatureVersion(2, 9)));
.add(new ConnectSpecDefinition(new FeatureVersion(0, 1), new FeatureVersion(2, 10)));

registerKnownFeature(CONNECT_VERSIONS);
4 changes: 2 additions & 2 deletions internals-js/src/specs/coreSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export class FeatureDefinitions<T extends FeatureDefinition = FeatureDefinition>
// this._definitions is already sorted with the most recent first
// get the first definition that is compatible with the federation version
// if the minimum version is not present, assume that we won't look for an older version
const def = this._definitions.find(def => def.minimumFederationVersion ? fedVersion >= def.minimumFederationVersion : true);
const def = this._definitions.find(def => def.minimumFederationVersion ? fedVersion.gte(def.minimumFederationVersion) : true);
assert(def, `No compatible definition exists for federation version ${fedVersion}`);

// note that it's necessary that we can only get versions that have the same major version as the latest,
Expand Down Expand Up @@ -670,7 +670,7 @@ export class FeatureVersion {
let max: FeatureVersion | undefined;

for (const version of versions) {
if (!max || version > max) {
if (!max || version.gt(max)) {
max = version;
}
}
Expand Down
5 changes: 3 additions & 2 deletions internals-js/src/specs/federationSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class FederationSpecDefinition extends FeatureDefinition {

this.registerSubFeature(INACCESSIBLE_VERSIONS.getMinimumRequiredVersion(version));

if (version >= (new FeatureVersion(2, 7))) {
if (version.gte(new FeatureVersion(2, 7))) {
this.registerDirective(createDirectiveSpecification({
name: FederationDirectiveName.OVERRIDE,
locations: [DirectiveLocation.FIELD_DEFINITION],
Expand Down Expand Up @@ -194,6 +194,7 @@ export const FEDERATION_VERSIONS = new FeatureDefinitions<FederationSpecDefiniti
.add(new FederationSpecDefinition(new FeatureVersion(2, 6)))
.add(new FederationSpecDefinition(new FeatureVersion(2, 7)))
.add(new FederationSpecDefinition(new FeatureVersion(2, 8)))
.add(new FederationSpecDefinition(new FeatureVersion(2, 9)));
.add(new FederationSpecDefinition(new FeatureVersion(2, 9)))
.add(new FederationSpecDefinition(new FeatureVersion(2, 10)));

registerKnownFeature(FEDERATION_VERSIONS);
1 change: 1 addition & 0 deletions internals-js/src/supergraphs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const ROUTER_SUPPORTED_SUPERGRAPH_FEATURES = new Set([
'https://specs.apollo.dev/source/v0.1',
'https://specs.apollo.dev/context/v0.1',
'https://specs.apollo.dev/cost/v0.1',
'https://specs.apollo.dev/connect/v0.1',
]);

const coreVersionZeroDotOneUrl = FeatureUrl.parse('https://specs.apollo.dev/core/v0.1');
Expand Down
4 changes: 2 additions & 2 deletions query-graphs-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/query-graphs",
"version": "2.9.0-connectors.9",
"version": "2.10.0-alpha.0",
"description": "Apollo Federation library to work with 'query graphs'",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -23,7 +23,7 @@
"node": ">=14.15.0"
},
"dependencies": {
"@apollo/federation-internals": "2.9.0-connectors.9",
"@apollo/federation-internals": "2.10.0-alpha.0",
"deep-equal": "^2.0.5",
"ts-graphviz": "^1.5.4",
"uuid": "^9.0.0"
Expand Down
6 changes: 3 additions & 3 deletions query-planner-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/query-planner",
"version": "2.9.0-connectors.9",
"version": "2.10.0-alpha.0",
"description": "Apollo Query Planner",
"author": "Apollo <[email protected]>",
"main": "dist/index.js",
Expand All @@ -25,8 +25,8 @@
"access": "public"
},
"dependencies": {
"@apollo/federation-internals": "2.9.0-connectors.9",
"@apollo/query-graphs": "2.9.0-connectors.9",
"@apollo/federation-internals": "2.10.0-alpha.0",
"@apollo/query-graphs": "2.10.0-alpha.0",
"@apollo/utils.keyvaluecache": "^2.1.0",
"chalk": "^4.1.0",
"deep-equal": "^2.0.5",
Expand Down
4 changes: 2 additions & 2 deletions subgraph-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/subgraph",
"version": "2.9.0-connectors.9",
"version": "2.10.0-alpha.0",
"description": "Apollo Subgraph Utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -25,7 +25,7 @@
},
"dependencies": {
"@apollo/cache-control-types": "^1.0.2",
"@apollo/federation-internals": "2.9.0-connectors.9"
"@apollo/federation-internals": "2.10.0-alpha.0"
},
"peerDependencies": {
"graphql": "^16.5.0"
Expand Down

0 comments on commit d72d138

Please sign in to comment.