Skip to content

Commit 3a5d690

Browse files
committed
Fix bug in JOIN_VERSIONS definition and update tests
1 parent b8e21ac commit 3a5d690

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

composition-js/src/__tests__/__snapshots__/compose.composeDirective.test.ts.snap

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`composing custom core directives custom tag directive works when federation tag is renamed 1`] = `
44
"schema
55
@link(url: \\"https://specs.apollo.dev/link/v1.0\\")
6-
@link(url: \\"https://specs.apollo.dev/join/v0.3\\", for: EXECUTION)
6+
@link(url: \\"https://specs.apollo.dev/join/v0.2\\", for: EXECUTION)
77
@link(url: \\"https://specs.apollo.dev/tag/v0.3\\", as: \\"mytag\\")
88
@link(url: \\"https://custom.dev/tag/v1.0\\", import: [\\"@tag\\"])
99
{
@@ -14,16 +14,12 @@ directive @link(url: String, as: String, for: link__Purpose, import: [link__Impo
1414
1515
directive @join__graph(name: String!, url: String!) on ENUM_VALUE
1616
17-
directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR
17+
directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR
1818
19-
directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
19+
directive @join__field(graph: join__Graph!, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
2020
2121
directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE
2222
23-
directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION
24-
25-
directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE
26-
2723
directive @mytag(name: String!) repeatable on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION | SCHEMA
2824
2925
directive @tag(name: String!, prop: String!) on FIELD_DEFINITION | OBJECT

composition-js/src/__tests__/compose.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,7 @@ describe('composition', () => {
24482448
const subgraphA = {
24492449
typeDefs: gql`
24502450
extend schema @link(
2451-
url: "https://specs.apollo.dev/federation/v2.0",
2451+
url: "https://specs.apollo.dev/federation/v2.3",
24522452
import: [{ name: "@key", as: "@identity"}, {name: "@requires", as: "@gimme"}, {name: "@external", as: "@notInThisSubgraph"}]
24532453
)
24542454
@@ -2469,7 +2469,7 @@ describe('composition', () => {
24692469
const subgraphB = {
24702470
typeDefs: gql`
24712471
extend schema @link(
2472-
url: "https://specs.apollo.dev/federation/v2.0",
2472+
url: "https://specs.apollo.dev/federation/v2.3",
24732473
import: [{ name: "@key", as: "@myKey"}]
24742474
)
24752475
@@ -4676,10 +4676,14 @@ describe('composition', () => {
46764676
}
46774677

46784678
it.each([
4679-
{ subgraphFedVersion: "2.4", expectedJoinVersion: "0.3"},
4680-
{ subgraphFedVersion: "2.5", expectedJoinVersion: "0.3"},
4681-
{ subgraphFedVersion: "2.6", expectedJoinVersion: "0.3"},
4682-
{ subgraphFedVersion: "2.7", expectedJoinVersion: "0.4"},
4679+
{ subgraphFedVersion: "2.0", expectedJoinVersion: "0.2" },
4680+
{ subgraphFedVersion: "2.1", expectedJoinVersion: "0.2" },
4681+
{ subgraphFedVersion: "2.2", expectedJoinVersion: "0.2" },
4682+
{ subgraphFedVersion: "2.3", expectedJoinVersion: "0.3" },
4683+
{ subgraphFedVersion: "2.4", expectedJoinVersion: "0.3" },
4684+
{ subgraphFedVersion: "2.5", expectedJoinVersion: "0.3" },
4685+
{ subgraphFedVersion: "2.6", expectedJoinVersion: "0.3" },
4686+
{ subgraphFedVersion: "2.7", expectedJoinVersion: "0.4" },
46834687
{ subgraphFedVersion: "2.8", expectedJoinVersion: "0.5" },
46844688
])("federation -> join versions", ({ subgraphFedVersion, expectedJoinVersion }) => {
46854689
const subgraph = subgraphWithFederationSpecVersion(subgraphFedVersion);

internals-js/src/specs/joinSpec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ export class JoinSpecDefinition extends FeatureDefinition {
286286
// - 0.5: adds the `contextArguments` argument to `@join_field` for setting context.
287287
export const JOIN_VERSIONS = new FeatureDefinitions<JoinSpecDefinition>(joinIdentity)
288288
.add(new JoinSpecDefinition(new FeatureVersion(0, 1)))
289-
.add(new JoinSpecDefinition(new FeatureVersion(0, 2)))
290-
.add(new JoinSpecDefinition(new FeatureVersion(0, 3), new FeatureVersion(2, 0)))
289+
.add(new JoinSpecDefinition(new FeatureVersion(0, 2), new FeatureVersion(2, 0)))
290+
.add(new JoinSpecDefinition(new FeatureVersion(0, 3), new FeatureVersion(2, 3)))
291291
.add(new JoinSpecDefinition(new FeatureVersion(0, 4), new FeatureVersion(2, 7)))
292292
.add(new JoinSpecDefinition(new FeatureVersion(0, 5), new FeatureVersion(2, 8)));
293293

0 commit comments

Comments
 (0)