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

refactor(2904): clean up apollo federation #2906

Closed
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
19 changes: 19 additions & 0 deletions src/core/blueprint/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,19 @@
Self { map, schema: blueprint.schema.to_owned() }
}
}

Check warning on line 183 in src/core/blueprint/index.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

Diff in /home/runner/work/tailcall/tailcall/src/core/blueprint/index.rs
#[cfg(test)]
mod test {
use super::Index;
use crate::core::blueprint::Blueprint;
use crate::core::config::ConfigModule;
use crate::core::valid::Valid;
use crate::core::ir::model::IR;
use crate::core::blueprint::operators::federation::compile_service;
use insta::assert_snapshot;
use crate::include_config;


fn setup() -> Index {
let config = include_config!("./fixture/all-constructs.graphql").unwrap();
let cfg_module = ConfigModule::from(config);
Expand Down Expand Up @@ -261,4 +266,18 @@
assert!(index.is_type_implements("Post", "Post"));
assert!(!index.is_type_implements("Node", "User"));
}

#[test]
fn test_compile_service_snapshot() {
let config = include_config!("./fixture/all-constructs.graphql").unwrap();
let cfg_module = ConfigModule::from(config);

let result = compile_service(&cfg_module);

if let Ok(IR::Service(output)) = result {
assert_snapshot!(output);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot file is missing in the project.

} else {
panic!("Expected Valid::Success");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop if condition use unwrap.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,40 @@
.map_to(IR::Entity(resolver_by_type))
}

pub fn compile_service(config: &ConfigModule) -> Valid<IR, String> {
let mut sdl =
crate::core::document::print(filter_conflicting_directives(config.config().into()));

writeln!(sdl).ok();
// Add tailcall specific definitions to the sdl output
writeln!(
sdl,
"{}",
crate::core::document::print(filter_conflicting_directives(Config::graphql_schema()))
)
.ok();
writeln!(sdl).ok();
// Mark subgraph as Apollo federation v2 compatible according to [docs](https://www.apollographql.com/docs/apollo-server/using-federation/apollo-subgraph-setup/#2-opt-in-to-federation-2)
// (borrowed from async_graphql)
writeln!(sdl, "extend schema @link(").ok();
writeln!(sdl, "\turl: \"https://specs.apollo.dev/federation/v2.3\",").ok();
writeln!(sdl, "\timport: [\"@key\", \"@tag\", \"@shareable\", \"@inaccessible\", \"@override\", \"@external\", \"@provides\", \"@requires\", \"@composeDirective\", \"@interfaceObject\"]").ok();
writeln!(sdl, ")").ok();

Valid::succeed(IR::Service(sdl))
pub fn compile_service(config: &ConfigModule) -> Result<Valid<IR>, String> {
let mut service_doc = ServiceDocument::from(config.config().into());

let federation_directive = DirectiveDefinition {

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

cannot find struct, variant or union type `DirectiveDefinition` in this scope

Check failure on line 85 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

cannot find struct, variant or union type `DirectiveDefinition` in this scope
name: "link".to_string(),
arguments: vec![
Argument {

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 88 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

cannot find struct, variant or union type `Argument` in this scope
name: "url".to_string(),
value: Value::String("https://specs.apollo.dev/federation/v2.3".to_string()),

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

failed to resolve: use of undeclared type `Value`

Check failure on line 90 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

failed to resolve: use of undeclared type `Value`
},
Argument {

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

cannot find struct, variant or union type `Argument` in this scope

Check failure on line 92 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

cannot find struct, variant or union type `Argument` in this scope
name: "import".to_string(),
value: Value::List(vec![

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

failed to resolve: use of undeclared type `Value`

Check failure on line 94 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

failed to resolve: use of undeclared type `Value`
Value::String("@key".to_string()),

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

failed to resolve: use of undeclared type `Value`

Check failure on line 95 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

failed to resolve: use of undeclared type `Value`
Value::String("@tag".to_string()),

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

failed to resolve: use of undeclared type `Value`

Check failure on line 96 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

failed to resolve: use of undeclared type `Value`
Value::String("@shareable".to_string()),

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

failed to resolve: use of undeclared type `Value`

Check failure on line 97 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

failed to resolve: use of undeclared type `Value`
Value::String("@inaccessible".to_string()),

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

failed to resolve: use of undeclared type `Value`

Check failure on line 98 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

failed to resolve: use of undeclared type `Value`
Value::String("@override".to_string()),

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Test AWS Lambda Build

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Check Examples

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (Cloudflare)

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests (WASM)

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-x64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-arm64-musl

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on linux-ia32-gnu

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-x64

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on darwin-arm64

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-ia32-msvc

failed to resolve: use of undeclared type `Value`

Check failure on line 99 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Tests on win32-x64-msvc

failed to resolve: use of undeclared type `Value`
Value::String("@external".to_string()),
Value::String("@provides".to_string()),
Value::String("@requires".to_string()),
Value::String("@composeDirective".to_string()),
Value::String("@interfaceObject".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to take a vec of strings and map over them to create a value::string

]),
},
],
};

service_doc.add_directive(federation_directive);

Check warning on line 110 in src/core/blueprint/operators/federation.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

Diff in /home/runner/work/tailcall/tailcall/src/core/blueprint/operators/federation.rs

let mut complete_sdl = String::new();
writeln!(complete_sdl, "{}", crate::core::document::print(service_doc))?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think we need writeln. Just call print directly.


Ok(Valid::succeed(IR::Service(complete_sdl)))
}

fn filter_conflicting_directives(sd: ServiceDocument) -> ServiceDocument {
Expand Down
4 changes: 2 additions & 2 deletions src/core/blueprint/operators/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
mod apollo_federation;
pub mod federation;

Check warning on line 1 in src/core/blueprint/operators/mod.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

Diff in /home/runner/work/tailcall/tailcall/src/core/blueprint/operators/mod.rs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub mod federation;
mod federation;

mod call;
mod enum_alias;
mod expr;
mod graphql;

Check warning on line 5 in src/core/blueprint/operators/mod.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

Diff in /home/runner/work/tailcall/tailcall/src/core/blueprint/operators/mod.rs
mod grpc;
mod http;
mod js;
mod modify;

Check warning on line 9 in src/core/blueprint/operators/mod.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

Diff in /home/runner/work/tailcall/tailcall/src/core/blueprint/operators/mod.rs
mod protected;

pub use apollo_federation::*;
pub use federation::*;
pub use call::*;
pub use enum_alias::*;
pub use expr::*;
pub use graphql::*;

Check warning on line 16 in src/core/blueprint/operators/mod.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

Diff in /home/runner/work/tailcall/tailcall/src/core/blueprint/operators/mod.rs
pub use grpc::*;
pub use http::*;
pub use js::*;
Expand Down
Loading