diff --git a/.changeset/hungry-llamas-remember.md b/.changeset/hungry-llamas-remember.md deleted file mode 100644 index e295a96db..000000000 --- a/.changeset/hungry-llamas-remember.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -"@apollo/query-planner": minor -"@apollo/query-graphs": minor -"@apollo/composition": minor -"@apollo/federation-internals": minor -"@apollo/gateway": minor ---- - -Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the `prop` field within the Child resolver. - -```graphql -type Query { - p: Parent! -} -type Parent @key(fields: "id") @context(name: "context") { - id: ID! - child: Child! - prop: String! -} -type Child @key(fields: "id") { - id: ID! - b: String! - field(a: String @fromContext(field: "$context { prop }")): Int! -} -``` diff --git a/.changeset/popular-chairs-happen.md b/.changeset/popular-chairs-happen.md deleted file mode 100644 index 3f7d7a122..000000000 --- a/.changeset/popular-chairs-happen.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"apollo-federation-integration-testsuite": patch -"@apollo/query-planner": patch -"@apollo/query-graphs": patch -"@apollo/composition": patch -"@apollo/federation-internals": patch -"@apollo/subgraph": patch -"@apollo/gateway": patch ---- - -Various set context bugfixes diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 96d9d2ccb..000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "mode": "exit", - "tag": "alpha", - "initialVersions": { - "@apollo/composition": "2.7.8", - "apollo-federation-integration-testsuite": "2.7.8", - "@apollo/gateway": "2.7.8", - "@apollo/federation-internals": "2.7.8", - "@apollo/query-graphs": "2.7.8", - "@apollo/query-planner": "2.7.8", - "@apollo/subgraph": "2.7.8" - }, - "changesets": [ - "hungry-llamas-remember", - "quick-zebras-wave", - "rare-grapes-dream" - ] -} diff --git a/.changeset/quick-zebras-wave.md b/.changeset/quick-zebras-wave.md deleted file mode 100644 index 37a5838e5..000000000 --- a/.changeset/quick-zebras-wave.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@apollo/query-graphs": patch ---- - -Fix bug in context-matching logic for interfaces-implementing-interfaces (#3014) - -A field is considered to match a context if the field's parent type (in the original query) either has `@context` on it, or implements/is a member of a type with `@context` on it. We ended up missing the case where interfaces implement interfaces; this PR introduces a fix. diff --git a/.changeset/rare-grapes-dream.md b/.changeset/rare-grapes-dream.md deleted file mode 100644 index 6f54cbabd..000000000 --- a/.changeset/rare-grapes-dream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@apollo/query-planner": patch ---- - -Fix relative path logic when eliding subgraph jumps for `@fromContext` diff --git a/composition-js/CHANGELOG.md b/composition-js/CHANGELOG.md index b84c10e2e..12502aa04 100644 --- a/composition-js/CHANGELOG.md +++ b/composition-js/CHANGELOG.md @@ -1,5 +1,35 @@ # CHANGELOG for `@apollo/composition` +## 2.8.0 + +### Minor Changes + +- Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the `prop` field within the Child resolver. ([#2988](https://github.com/apollographql/federation/pull/2988)) + + ```graphql + type Query { + p: Parent! + } + type Parent @key(fields: "id") @context(name: "context") { + id: ID! + child: Child! + prop: String! + } + type Child @key(fields: "id") { + id: ID! + b: String! + field(a: String @fromContext(field: "$context { prop }")): Int! + } + ``` + +### Patch Changes + +- Various set context bugfixes ([#3017](https://github.com/apollographql/federation/pull/3017)) + +- Updated dependencies [[`c4744da360235d8bb8270ea048f0e0fa5d03be1e`](https://github.com/apollographql/federation/commit/c4744da360235d8bb8270ea048f0e0fa5d03be1e), [`8a936d741a0c05835ff2533714cf330d18209179`](https://github.com/apollographql/federation/commit/8a936d741a0c05835ff2533714cf330d18209179), [`f5fe3e74d36722f78004c1e2e03c77d8b95cd6bf`](https://github.com/apollographql/federation/commit/f5fe3e74d36722f78004c1e2e03c77d8b95cd6bf)]: + - @apollo/query-graphs@2.8.0 + - @apollo/federation-internals@2.8.0 + ## 2.8.0-alpha.1 ### Patch Changes diff --git a/composition-js/package.json b/composition-js/package.json index d01dc2daa..95f8d62ce 100644 --- a/composition-js/package.json +++ b/composition-js/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/composition", - "version": "2.8.0-alpha.1", + "version": "2.8.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.8.0-alpha.1", - "@apollo/query-graphs": "2.8.0-alpha.1" + "@apollo/federation-internals": "2.8.0", + "@apollo/query-graphs": "2.8.0" }, "peerDependencies": { "graphql": "^16.5.0" diff --git a/federation-integration-testsuite-js/CHANGELOG.md b/federation-integration-testsuite-js/CHANGELOG.md index 51fe5e251..06d3c6a9d 100644 --- a/federation-integration-testsuite-js/CHANGELOG.md +++ b/federation-integration-testsuite-js/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG for `federation-integration-testsuite-js` +## 2.8.0 + +### Patch Changes + +- Various set context bugfixes ([#3017](https://github.com/apollographql/federation/pull/3017)) + ## 2.8.0-alpha.1 ## 2.8.0-alpha.0 diff --git a/federation-integration-testsuite-js/package.json b/federation-integration-testsuite-js/package.json index 63cfd2e53..3cf292506 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.8.0-alpha.1", + "version": "2.8.0", "description": "Apollo Federation Integrations / Test Fixtures", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/gateway-js/CHANGELOG.md b/gateway-js/CHANGELOG.md index a154ec296..529a97b9b 100644 --- a/gateway-js/CHANGELOG.md +++ b/gateway-js/CHANGELOG.md @@ -1,5 +1,36 @@ # CHANGELOG for `@apollo/gateway` +## 2.8.0 + +### Minor Changes + +- Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the `prop` field within the Child resolver. ([#2988](https://github.com/apollographql/federation/pull/2988)) + + ```graphql + type Query { + p: Parent! + } + type Parent @key(fields: "id") @context(name: "context") { + id: ID! + child: Child! + prop: String! + } + type Child @key(fields: "id") { + id: ID! + b: String! + field(a: String @fromContext(field: "$context { prop }")): Int! + } + ``` + +### Patch Changes + +- Various set context bugfixes ([#3017](https://github.com/apollographql/federation/pull/3017)) + +- Updated dependencies [[`c4744da360235d8bb8270ea048f0e0fa5d03be1e`](https://github.com/apollographql/federation/commit/c4744da360235d8bb8270ea048f0e0fa5d03be1e), [`8a936d741a0c05835ff2533714cf330d18209179`](https://github.com/apollographql/federation/commit/8a936d741a0c05835ff2533714cf330d18209179), [`daf36bd242ba4db0cfcf0e18c1eed235ff0dfaf2`](https://github.com/apollographql/federation/commit/daf36bd242ba4db0cfcf0e18c1eed235ff0dfaf2)]: + - @apollo/query-planner@2.8.0 + - @apollo/composition@2.8.0 + - @apollo/federation-internals@2.8.0 + ## 2.8.0-alpha.1 ### Patch Changes diff --git a/gateway-js/package.json b/gateway-js/package.json index c4fbafa88..419a12e8b 100644 --- a/gateway-js/package.json +++ b/gateway-js/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/gateway", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "description": "Apollo Gateway", "author": "Apollo ", "main": "dist/index.js", @@ -25,9 +25,9 @@ "access": "public" }, "dependencies": { - "@apollo/composition": "2.8.0-alpha.1", - "@apollo/federation-internals": "2.8.0-alpha.1", - "@apollo/query-planner": "2.8.0-alpha.1", + "@apollo/composition": "2.8.0", + "@apollo/federation-internals": "2.8.0", + "@apollo/query-planner": "2.8.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/CHANGELOG.md b/internals-js/CHANGELOG.md index 0664b965f..eaad39df6 100644 --- a/internals-js/CHANGELOG.md +++ b/internals-js/CHANGELOG.md @@ -1,5 +1,31 @@ # CHANGELOG for `@apollo/federation-internals` +## 2.8.0 + +### Minor Changes + +- Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the `prop` field within the Child resolver. ([#2988](https://github.com/apollographql/federation/pull/2988)) + + ```graphql + type Query { + p: Parent! + } + type Parent @key(fields: "id") @context(name: "context") { + id: ID! + child: Child! + prop: String! + } + type Child @key(fields: "id") { + id: ID! + b: String! + field(a: String @fromContext(field: "$context { prop }")): Int! + } + ``` + +### Patch Changes + +- Various set context bugfixes ([#3017](https://github.com/apollographql/federation/pull/3017)) + ## 2.8.0-alpha.1 ## 2.8.0-alpha.0 diff --git a/internals-js/package.json b/internals-js/package.json index 7f4b5793e..6a3da64b6 100644 --- a/internals-js/package.json +++ b/internals-js/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/federation-internals", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "description": "Apollo Federation internal utilities", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/package-lock.json b/package-lock.json index ccf052575..043aead09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,11 +70,11 @@ }, "composition-js": { "name": "@apollo/composition", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "license": "Elastic-2.0", "dependencies": { - "@apollo/federation-internals": "2.8.0-alpha.1", - "@apollo/query-graphs": "2.8.0-alpha.1" + "@apollo/federation-internals": "2.8.0", + "@apollo/query-graphs": "2.8.0" }, "engines": { "node": ">=14.15.0" @@ -85,7 +85,7 @@ }, "federation-integration-testsuite-js": { "name": "apollo-federation-integration-testsuite", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "license": "Elastic-2.0", "dependencies": { "graphql-tag": "^2.12.6", @@ -94,12 +94,12 @@ }, "gateway-js": { "name": "@apollo/gateway", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "license": "Elastic-2.0", "dependencies": { - "@apollo/composition": "2.8.0-alpha.1", - "@apollo/federation-internals": "2.8.0-alpha.1", - "@apollo/query-planner": "2.8.0-alpha.1", + "@apollo/composition": "2.8.0", + "@apollo/federation-internals": "2.8.0", + "@apollo/query-planner": "2.8.0", "@apollo/server-gateway-interface": "^1.1.0", "@apollo/usage-reporting-protobuf": "^4.1.0", "@apollo/utils.createhash": "^2.0.0", @@ -125,7 +125,7 @@ }, "internals-js": { "name": "@apollo/federation-internals", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "license": "Elastic-2.0", "dependencies": { "@types/uuid": "^9.0.0", @@ -17841,10 +17841,10 @@ }, "query-graphs-js": { "name": "@apollo/query-graphs", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "license": "Elastic-2.0", "dependencies": { - "@apollo/federation-internals": "2.8.0-alpha.1", + "@apollo/federation-internals": "2.8.0", "deep-equal": "^2.0.5", "ts-graphviz": "^1.5.4", "uuid": "^9.0.0" @@ -17858,11 +17858,11 @@ }, "query-planner-js": { "name": "@apollo/query-planner", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "license": "Elastic-2.0", "dependencies": { - "@apollo/federation-internals": "2.8.0-alpha.1", - "@apollo/query-graphs": "2.8.0-alpha.1", + "@apollo/federation-internals": "2.8.0", + "@apollo/query-graphs": "2.8.0", "@apollo/utils.keyvaluecache": "^2.1.0", "chalk": "^4.1.0", "deep-equal": "^2.0.5", @@ -17891,11 +17891,11 @@ }, "subgraph-js": { "name": "@apollo/subgraph", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "license": "MIT", "dependencies": { "@apollo/cache-control-types": "^1.0.2", - "@apollo/federation-internals": "2.8.0-alpha.1" + "@apollo/federation-internals": "2.8.0" }, "engines": { "node": ">=14.15.0" diff --git a/query-graphs-js/CHANGELOG.md b/query-graphs-js/CHANGELOG.md index 218d82086..8839c998b 100644 --- a/query-graphs-js/CHANGELOG.md +++ b/query-graphs-js/CHANGELOG.md @@ -1,5 +1,38 @@ # CHANGELOG for `@apollo/query-graphs` +## 2.8.0 + +### Minor Changes + +- Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the `prop` field within the Child resolver. ([#2988](https://github.com/apollographql/federation/pull/2988)) + + ```graphql + type Query { + p: Parent! + } + type Parent @key(fields: "id") @context(name: "context") { + id: ID! + child: Child! + prop: String! + } + type Child @key(fields: "id") { + id: ID! + b: String! + field(a: String @fromContext(field: "$context { prop }")): Int! + } + ``` + +### Patch Changes + +- Various set context bugfixes ([#3017](https://github.com/apollographql/federation/pull/3017)) + +- Fix bug in context-matching logic for interfaces-implementing-interfaces (#3014) ([#3015](https://github.com/apollographql/federation/pull/3015)) + + A field is considered to match a context if the field's parent type (in the original query) either has `@context` on it, or implements/is a member of a type with `@context` on it. We ended up missing the case where interfaces implement interfaces; this PR introduces a fix. + +- Updated dependencies [[`c4744da360235d8bb8270ea048f0e0fa5d03be1e`](https://github.com/apollographql/federation/commit/c4744da360235d8bb8270ea048f0e0fa5d03be1e), [`8a936d741a0c05835ff2533714cf330d18209179`](https://github.com/apollographql/federation/commit/8a936d741a0c05835ff2533714cf330d18209179)]: + - @apollo/federation-internals@2.8.0 + ## 2.8.0-alpha.1 ### Patch Changes diff --git a/query-graphs-js/package.json b/query-graphs-js/package.json index aa86d3567..854417298 100644 --- a/query-graphs-js/package.json +++ b/query-graphs-js/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/query-graphs", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "description": "Apollo Federation library to work with 'query graphs'", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -23,7 +23,7 @@ "node": ">=14.15.0" }, "dependencies": { - "@apollo/federation-internals": "2.8.0-alpha.1", + "@apollo/federation-internals": "2.8.0", "deep-equal": "^2.0.5", "ts-graphviz": "^1.5.4", "uuid": "^9.0.0" diff --git a/query-planner-js/CHANGELOG.md b/query-planner-js/CHANGELOG.md index 118643232..e9826dcd0 100644 --- a/query-planner-js/CHANGELOG.md +++ b/query-planner-js/CHANGELOG.md @@ -1,5 +1,37 @@ # CHANGELOG for `@apollo/query-planner` +## 2.8.0 + +### Minor Changes + +- Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the `prop` field within the Child resolver. ([#2988](https://github.com/apollographql/federation/pull/2988)) + + ```graphql + type Query { + p: Parent! + } + type Parent @key(fields: "id") @context(name: "context") { + id: ID! + child: Child! + prop: String! + } + type Child @key(fields: "id") { + id: ID! + b: String! + field(a: String @fromContext(field: "$context { prop }")): Int! + } + ``` + +### Patch Changes + +- Various set context bugfixes ([#3017](https://github.com/apollographql/federation/pull/3017)) + +- Fix relative path logic when eliding subgraph jumps for `@fromContext` ([#3005](https://github.com/apollographql/federation/pull/3005)) + +- Updated dependencies [[`c4744da360235d8bb8270ea048f0e0fa5d03be1e`](https://github.com/apollographql/federation/commit/c4744da360235d8bb8270ea048f0e0fa5d03be1e), [`8a936d741a0c05835ff2533714cf330d18209179`](https://github.com/apollographql/federation/commit/8a936d741a0c05835ff2533714cf330d18209179), [`f5fe3e74d36722f78004c1e2e03c77d8b95cd6bf`](https://github.com/apollographql/federation/commit/f5fe3e74d36722f78004c1e2e03c77d8b95cd6bf)]: + - @apollo/query-graphs@2.8.0 + - @apollo/federation-internals@2.8.0 + ## 2.8.0-alpha.1 ### Patch Changes diff --git a/query-planner-js/package.json b/query-planner-js/package.json index c18f52710..1fb0a3d10 100644 --- a/query-planner-js/package.json +++ b/query-planner-js/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/query-planner", - "version": "2.8.0-alpha.1", + "version": "2.8.0", "description": "Apollo Query Planner", "author": "Apollo ", "main": "dist/index.js", @@ -25,8 +25,8 @@ "access": "public" }, "dependencies": { - "@apollo/federation-internals": "2.8.0-alpha.1", - "@apollo/query-graphs": "2.8.0-alpha.1", + "@apollo/federation-internals": "2.8.0", + "@apollo/query-graphs": "2.8.0", "@apollo/utils.keyvaluecache": "^2.1.0", "chalk": "^4.1.0", "deep-equal": "^2.0.5", diff --git a/subgraph-js/CHANGELOG.md b/subgraph-js/CHANGELOG.md index 997213594..d0159a878 100644 --- a/subgraph-js/CHANGELOG.md +++ b/subgraph-js/CHANGELOG.md @@ -1,5 +1,14 @@ # CHANGELOG for `@apollo/subgraph` +## 2.8.0 + +### Patch Changes + +- Various set context bugfixes ([#3017](https://github.com/apollographql/federation/pull/3017)) + +- Updated dependencies [[`c4744da360235d8bb8270ea048f0e0fa5d03be1e`](https://github.com/apollographql/federation/commit/c4744da360235d8bb8270ea048f0e0fa5d03be1e), [`8a936d741a0c05835ff2533714cf330d18209179`](https://github.com/apollographql/federation/commit/8a936d741a0c05835ff2533714cf330d18209179)]: + - @apollo/federation-internals@2.8.0 + ## 2.8.0-alpha.1 ### Patch Changes diff --git a/subgraph-js/package.json b/subgraph-js/package.json index bfb2a40f4..0026bdb48 100644 --- a/subgraph-js/package.json +++ b/subgraph-js/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/subgraph", - "version": "2.8.0-alpha.1", + "version": "2.8.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.8.0-alpha.1" + "@apollo/federation-internals": "2.8.0" }, "peerDependencies": { "graphql": "^16.5.0"