Skip to content

Commit

Permalink
Merge branch 'main' into geal/plan-count
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal authored Aug 29, 2024
2 parents 2883d18 + 81f1ca7 commit c3f896a
Show file tree
Hide file tree
Showing 20 changed files with 651 additions and 163 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion harmonizer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "harmonizer"
version = "2.8.4"
version = "2.9.0"
authors = ["Apollo <[email protected]>"]
edition = "2018"
description = "Apollo Federation utility to compose a supergraph from subgraphs"
Expand Down
54 changes: 27 additions & 27 deletions harmonizer/package-lock.json

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

4 changes: 2 additions & 2 deletions harmonizer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@apollo/harmonizer-2",
"private": true,
"version": "2.8.4",
"version": "2.9.0",
"description": "Apollo Federation Harmonizer JS Entrypoint",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -29,7 +29,7 @@
"npm": ">=7 <11"
},
"dependencies": {
"@apollo/composition": "2.8.4"
"@apollo/composition": "2.9.0"
},
"peerDependencies": {
"graphql": "^15.7.0 || ^16.0.0"
Expand Down
2 changes: 1 addition & 1 deletion router-bridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "router-bridge"
version = "0.5.30+v2.8.3"
version = "0.6.0+v2.9.0"
authors = ["Apollo <[email protected]>"]
edition = "2018"
description = "JavaScript bridge for the Apollo Router"
Expand Down
3 changes: 2 additions & 1 deletion router-bridge/js-src/plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import {
Operation,
operationFromDocument,
printSchema as printSchemaWithDirectives,
Supergraph,
} from "@apollo/federation-internals";
import {
Expand Down Expand Up @@ -284,7 +285,7 @@ export class BridgeQueryPlanner {
let result = new Map<string, string>();

subgraphs.names().forEach((name) => {
let sdl = printSchema(subgraphs.get(name).schema.toGraphQLJSSchema({}));
let sdl = printSchemaWithDirectives(subgraphs.get(name).schema);
result.set(name, sdl);
});

Expand Down
2 changes: 2 additions & 0 deletions router-bridge/js-src/supported_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
REQUIRES_SCOPES_VERSIONS,
SOURCE_VERSIONS,
CONTEXT_VERSIONS,
COST_VERSIONS,
} from "@apollo/federation-internals";

export const ROUTER_SUPPORTED_SUPERGRAPH_FEATURES: Set<string> = new Set(
Expand All @@ -32,3 +33,4 @@ addToRouterFeatures(REQUIRES_SCOPES_VERSIONS);
addToRouterFeatures(POLICY_VERSIONS);
addToRouterFeatures(SOURCE_VERSIONS);
addToRouterFeatures(CONTEXT_VERSIONS);
addToRouterFeatures(COST_VERSIONS);
32 changes: 16 additions & 16 deletions router-bridge/package-lock.json

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

6 changes: 3 additions & 3 deletions router-bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@apollo/router-bridge",
"private": true,
"version": "2.8.3",
"version": "2.9.0",
"description": "Apollo Router JS Bridge Entrypoint",
"scripts": {
"build": "make-dir bundled js-dist && rm -f tsconfig.tsbuildinfo && tsc --build --verbose && node esbuild/bundler.js && cp js-dist/runtime.js js-dist/do_api_schema.js js-dist/do_introspect.js js-dist/plan_worker.js js-dist/test_logger_worker.js js-dist/test_get_random_values.js js-dist/test_url.js bundled/",
Expand All @@ -28,8 +28,8 @@
},
"dependencies": {
"@apollo/core-schema": "^0.3.0",
"@apollo/federation-internals": "^2.8.3",
"@apollo/query-planner": "^2.8.3",
"@apollo/federation-internals": "^2.9.0",
"@apollo/query-planner": "^2.9.0",
"@apollo/usage-reporting-protobuf": "^4.0.0",
"@apollo/utils.usagereporting": "^3.0.0",
"graphql": "16.6.0"
Expand Down
13 changes: 13 additions & 0 deletions router-bridge/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2466,4 +2466,17 @@ feature https://specs.apollo.dev/unsupported-feature/v0.1 is for: SECURITY but i
)
.unwrap());
}

#[tokio::test]
async fn extracts_cost_directives() {
let schema = include_str!("testdata/custom_cost_schema.graphql");
let planner = Planner::<serde_json::Value>::new(schema.to_string(), Default::default())
.await
.expect("can create planner");
let subgraphs = planner.subgraphs().await.expect("can extract subgraphs");

for (name, schema) in subgraphs {
insta::assert_snapshot!(name, schema);
}
}
}
Loading

0 comments on commit c3f896a

Please sign in to comment.