diff --git a/.changeset/pre.json b/.changeset/pre.json index 3316d41e8..862a226ff 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -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" + ] } diff --git a/composition-js/package.json b/composition-js/package.json index 67dc45331..9abe7df49 100644 --- a/composition-js/package.json +++ b/composition-js/package.json @@ -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", @@ -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" diff --git a/composition-js/src/__tests__/connectors.test.ts b/composition-js/src/__tests__/connectors.test.ts index ac3e4d837..2fe8e3419 100644 --- a/composition-js/src/__tests__/connectors.test.ts +++ b/composition-js/src/__tests__/connectors.test.ts @@ -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( @@ -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( @@ -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( @@ -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( diff --git a/composition-js/src/__tests__/hints.test.ts b/composition-js/src/__tests__/hints.test.ts index 4013b2e03..ce3cb6f33 100644 --- a/composition-js/src/__tests__/hints.test.ts +++ b/composition-js/src/__tests__/hints.test.ts @@ -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' ); }); @@ -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' ); }); diff --git a/composition-js/src/merging/merge.ts b/composition-js/src/merging/merge.ts index 2eee27e95..29c8e69ac 100644 --- a/composition-js/src/merging/merge.ts +++ b/composition-js/src/merging/merge.ts @@ -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; } diff --git a/federation-integration-testsuite-js/package.json b/federation-integration-testsuite-js/package.json index a65064895..e432e96bb 100644 --- a/federation-integration-testsuite-js/package.json +++ b/federation-integration-testsuite-js/package.json @@ -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", diff --git a/gateway-js/package.json b/gateway-js/package.json index 3a50ab9bc..66efd093a 100644 --- a/gateway-js/package.json +++ b/gateway-js/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/gateway", - "version": "2.9.0-connectors.9", + "version": "2.10.0-alpha.0", "description": "Apollo Gateway", "author": "Apollo ", "main": "dist/index.js", @@ -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", diff --git a/internals-js/package.json b/internals-js/package.json index 6185727c2..3d4564516 100644 --- a/internals-js/package.json +++ b/internals-js/package.json @@ -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", diff --git a/internals-js/src/federation.ts b/internals-js/src/federation.ts index 8f2c41b44..5add86e67 100644 --- a/internals-js/src/federation.ts +++ b/internals-js/src/federation.ts @@ -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"])'; diff --git a/internals-js/src/specs/connectSpec.ts b/internals-js/src/specs/connectSpec.ts index 11cf6e21d..1e9c421e9 100644 --- a/internals-js/src/specs/connectSpec.ts +++ b/internals-js/src/specs/connectSpec.ts @@ -178,6 +178,6 @@ export type ConnectDirectiveHTTP = { }; export const CONNECT_VERSIONS = new FeatureDefinitions(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); diff --git a/internals-js/src/specs/coreSpec.ts b/internals-js/src/specs/coreSpec.ts index 405557391..23894b640 100644 --- a/internals-js/src/specs/coreSpec.ts +++ b/internals-js/src/specs/coreSpec.ts @@ -618,7 +618,7 @@ export class FeatureDefinitions // 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, @@ -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; } } diff --git a/internals-js/src/specs/federationSpec.ts b/internals-js/src/specs/federationSpec.ts index aab9dd74d..37084b057 100644 --- a/internals-js/src/specs/federationSpec.ts +++ b/internals-js/src/specs/federationSpec.ts @@ -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], @@ -194,6 +194,7 @@ export const FEDERATION_VERSIONS = new FeatureDefinitions=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" diff --git a/query-planner-js/package.json b/query-planner-js/package.json index eca73b930..918c6d6e9 100644 --- a/query-planner-js/package.json +++ b/query-planner-js/package.json @@ -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 ", "main": "dist/index.js", @@ -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", diff --git a/subgraph-js/package.json b/subgraph-js/package.json index 809838a38..e99d66119 100644 --- a/subgraph-js/package.json +++ b/subgraph-js/package.json @@ -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", @@ -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"