Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into next #3130

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions composition-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG for `@apollo/composition`

## 2.8.5

### Patch Changes

- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]

## 2.8.4

### Patch Changes
Expand Down
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.8.4",
"version": "2.8.5",
"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.8.4",
"@apollo/query-graphs": "2.8.4"
"@apollo/federation-internals": "2.8.5",
"@apollo/query-graphs": "2.8.5"
},
"peerDependencies": {
"graphql": "^16.5.0"
Expand Down
6 changes: 6 additions & 0 deletions docs/source/entities/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ subtitle: Learn how to define federated types across multiple subgraphs
description: Learn to define and contribute to object types that resolve their fields across multiple services in a federated GraphQL architecture.
---

<SummitCallout
topic="entities"
workshopName="Federation from day 1: Thinking in entities"
URL="https://reg.summit.graphql.com/flow/apollo/summit24/AttendeePortal/page/catalog/session/1712947980868001Lumq"
/>

_Entities_ are a fundamental building block of Apollo Federation.
In a supergraph, an entity is an object type that can resolve its fields across multiple subgraphs.
Each subgraph can contribute different fields to the entity and is responsible for resolving only the fields that it contributes.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/federation-2/moving-to-federation-2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Federation 2 provides powerful new features that require making some changes to
- Safely migrating fields from one subgraph to another with [`@override`](../federated-types/federated-directives#override)
- Hiding internal routing fields from graph consumers with [`@inaccessible`](../federated-types/federated-directives#inaccessible)

The schema changes you make are backward incompatible with Federation 1, which means you won't be able to use Federation 1 composition anymore unless you revert those changes.
The schema changes you make are not backward compatible with Federation 1, which means you won't be able to use Federation 1 composition anymore unless you revert those changes.

### Update your subgraph library

Expand Down
6 changes: 6 additions & 0 deletions docs/source/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ subtitle: Learn how to combine your GraphQL APIs into a unified supergraph
description: Learn how Apollo Federation can help you declaratively combine your services into a unified, federated GraphQL API using a microservices architecture.
---

<SummitCallout
topic="federation"
workshopName="Federation from day 1: Thinking in entities"
URL="https://reg.summit.graphql.com/flow/apollo/summit24/AttendeePortal/page/catalog/session/1712947980868001Lumq"
/>

## What is Apollo Federation?

Apollo Federation lets you declaratively combine multiple GraphQL APIs into a single, federated graph. This federated graph enables clients to interact with multiple APIs through a single request.
Expand Down
6 changes: 6 additions & 0 deletions docs/source/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ To learn more about Apollo Federation and the benefits of using it with GraphOS,
- [Introduction to Apollo Federation](./)
- [Introduction to GraphOS](/graphos)

<SummitCallout
topic="federation"
workshopName="Federation from day 1: Thinking in entities"
URL="https://reg.summit.graphql.com/flow/apollo/summit24/AttendeePortal/page/catalog/session/1712947980868001Lumq"
/>

## Prerequisites

To complete this quickstart, you must have the following:
Expand Down
2 changes: 2 additions & 0 deletions federation-integration-testsuite-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGELOG for `federation-integration-testsuite-js`

## 2.8.5

## 2.8.4

## 2.8.3
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.8.4",
"version": "2.8.5",
"description": "Apollo Federation Integrations / Test Fixtures",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions gateway-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG for `@apollo/gateway`

## 2.8.5

### Patch Changes

- Updated dependencies [[`926cbb7949200e12b81100a07fa3438b5ae9efd0`](https://github.com/apollographql/federation/commit/926cbb7949200e12b81100a07fa3438b5ae9efd0)]:
- @apollo/[email protected]
- @apollo/[email protected]
- @apollo/[email protected]

## 2.8.4

### Patch Changes
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.8.4",
"version": "2.8.5",
"description": "Apollo Gateway",
"author": "Apollo <[email protected]>",
"main": "dist/index.js",
Expand All @@ -25,9 +25,9 @@
"access": "public"
},
"dependencies": {
"@apollo/composition": "2.8.4",
"@apollo/federation-internals": "2.8.4",
"@apollo/query-planner": "2.8.4",
"@apollo/composition": "2.8.5",
"@apollo/federation-internals": "2.8.5",
"@apollo/query-planner": "2.8.5",
"@apollo/server-gateway-interface": "^1.1.0",
"@apollo/usage-reporting-protobuf": "^4.1.0",
"@apollo/utils.createhash": "^2.0.0",
Expand Down
2 changes: 2 additions & 0 deletions internals-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGELOG for `@apollo/federation-internals`

## 2.8.5

## 2.8.4

### Patch Changes
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.8.4",
"version": "2.8.5",
"description": "Apollo Federation internal utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions query-graphs-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG for `@apollo/query-graphs`

## 2.8.5

### Patch Changes

- Updated dependencies []:
- @apollo/[email protected]

## 2.8.4

### Patch Changes
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.8.4",
"version": "2.8.5",
"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.8.4",
"@apollo/federation-internals": "2.8.5",
"deep-equal": "^2.0.5",
"ts-graphviz": "^1.5.4",
"uuid": "^9.0.0"
Expand Down
10 changes: 10 additions & 0 deletions query-planner-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG for `@apollo/query-planner`

## 2.8.5

### Patch Changes

- Switched plan count from `Number` to a `BigInt`. ([#3128](https://github.com/apollographql/federation/pull/3128))

- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]

## 2.8.4

### Patch Changes
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.8.4",
"version": "2.8.5",
"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.8.4",
"@apollo/query-graphs": "2.8.4",
"@apollo/federation-internals": "2.8.5",
"@apollo/query-graphs": "2.8.5",
"@apollo/utils.keyvaluecache": "^2.1.0",
"chalk": "^4.1.0",
"deep-equal": "^2.0.5",
Expand Down
14 changes: 7 additions & 7 deletions query-planner-js/src/buildPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ class QueryPlanningTraversal<RV extends Vertex> {
const maxPlansToCompute = this.parameters.config.debug.maxEvaluatedPlans;
while (planCount > maxPlansToCompute && firstBranch.length > 1) {
// we remove the right-most option of the first branch, and them move that branch to it's new place.
const prevSize = firstBranch.length;
const prevSize = BigInt(firstBranch.length);
firstBranch.pop();
planCount -= planCount / prevSize;
this.reorderFirstBranch();
Expand All @@ -679,7 +679,7 @@ class QueryPlanningTraversal<RV extends Vertex> {
// Note that if `!this.isTopLevel`, then this means we're resolving a sub-plan for an edge condition, and we
// don't want to count those as "evaluated plans".
if (this.parameters.statistics && this.isTopLevel) {
this.parameters.statistics.evaluatedPlanCount += planCount;
this.parameters.statistics.evaluatedPlanCount += Number(planCount);
}

debug.log(() => `All branches:${this.closedBranches.map((opts, i) => `\n${i}:${opts.map((opt => `\n - ${closedPathToString(opt)}`))}`)}`);
Expand Down Expand Up @@ -3610,16 +3610,16 @@ function mapOptionsToSelections<RV extends Vertex>(
return selectionSet.selectionsInReverseOrder().map(node => [node, options]);
}

function possiblePlans(closedBranches: ClosedBranch<any>[]): number {
let totalCombinations = 1;
function possiblePlans(closedBranches: ClosedBranch<any>[]): bigint {
let totalCombinations = BigInt(1);
for (let i = 0; i < closedBranches.length; ++i){
const eltSize = closedBranches[i].length;
if (eltSize === 0) {
const eltSize = BigInt(closedBranches[i].length);
if (eltSize === BigInt(0)) {
// This would correspond to not being to find *any* path for a particular queried field, which means we have no plan
// for the overall query. Now, this shouldn't happen in practice if composition validation has been run successfully
// (and is not buggy), since the goal of composition validation is exactly to ensure we can never run into this path.
// In any case, we will throw later if that happens, but let's just return the proper result here, which is no plan at all.
return 0;
return BigInt(0);
}
totalCombinations *= eltSize;
}
Expand Down
7 changes: 7 additions & 0 deletions subgraph-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG for `@apollo/subgraph`

## 2.8.5

### Patch Changes

- Updated dependencies []:
- @apollo/[email protected]

## 2.8.4

### Patch Changes
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.8.4",
"version": "2.8.5",
"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.8.4"
"@apollo/federation-internals": "2.8.5"
},
"peerDependencies": {
"graphql": "^16.5.0"
Expand Down
Loading