From 1b939730ae71ec906030afd6f08ff37427d4482f Mon Sep 17 00:00:00 2001 From: Duckki Oe Date: Fri, 2 May 2025 16:38:52 -0700 Subject: [PATCH] deleted a moved test module --- apollo-federation/src/subgraph/typestate.rs | 153 -------------------- 1 file changed, 153 deletions(-) diff --git a/apollo-federation/src/subgraph/typestate.rs b/apollo-federation/src/subgraph/typestate.rs index a62f5fa248..d0f5f9f0d1 100644 --- a/apollo-federation/src/subgraph/typestate.rs +++ b/apollo-federation/src/subgraph/typestate.rs @@ -894,156 +894,3 @@ mod tests { ); } } - -// PORT_NOTE: Corresponds to '@core/@link handling' tests in JS -#[cfg(test)] -mod link_handling_tests { - use super::*; - - // TODO(FED-543): Remaining directive definitions should be added to the schema - #[allow(dead_code)] - const EXPECTED_FULL_SCHEMA: &str = r#" - schema - @link(url: "https://specs.apollo.dev/link/v1.0") - @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key"]) - { - query: Query - } - - directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA - - directive @key(fields: federation__FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE - - directive @federation__requires(fields: federation__FieldSet!) on FIELD_DEFINITION - - directive @federation__provides(fields: federation__FieldSet!) on FIELD_DEFINITION - - directive @federation__external(reason: String) on OBJECT | FIELD_DEFINITION - - directive @federation__tag(name: String!) repeatable on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION - - directive @federation__extends on OBJECT | INTERFACE - - directive @federation__shareable on OBJECT | FIELD_DEFINITION - - directive @federation__inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION - - directive @federation__override(from: String!) on FIELD_DEFINITION - - type T - @key(fields: "k") - { - k: ID! - } - - enum link__Purpose { - """ - \`SECURITY\` features provide metadata necessary to securely resolve fields. - """ - SECURITY - - """ - \`EXECUTION\` features provide metadata necessary for operation execution. - """ - EXECUTION - } - - scalar link__Import - - scalar federation__FieldSet - - scalar _Any - - type _Service { - sdl: String - } - - union _Entity = T - - type Query { - _entities(representations: [_Any!]!): [_Entity]! - _service: _Service! - } - "#; - - #[test] - fn expands_everything_if_only_the_federation_spec_is_linked() { - let subgraph = Subgraph::parse( - "S", - "", - r#" - extend schema - @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key"]) - - type T @key(fields: "k") { - k: ID! - } - "#, - ) - .expect("valid schema") - .expand_links() - .expect("expands subgraph") - .validate(true) - .expect("expanded subgraph to be valid"); - - // TODO(FED-543): `subgraph` is supposed to be compared against `EXPECTED_FULL_SCHEMA`, but - // it's failing due to missing directive definitions. So, we use - // `insta::assert_snapshot` for now. - // assert_eq!(subgraph.schema().schema().to_string(), EXPECTED_FULL_SCHEMA); - insta::assert_snapshot!(subgraph.schema().schema().to_string(), @r###" - schema @link(url: "https://specs.apollo.dev/link/v1.0") { - query: Query - } - - extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key"]) - - directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA - - directive @key(fields: federation__FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE - - directive @federation__requires(fields: federation__FieldSet!) on FIELD_DEFINITION - - directive @federation__provides(fields: federation__FieldSet!) on FIELD_DEFINITION - - directive @federation__external(reason: String) on OBJECT | FIELD_DEFINITION - - directive @federation__shareable on OBJECT | FIELD_DEFINITION - - directive @federation__override(from: String!) on FIELD_DEFINITION - - directive @federation__tag repeatable on ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION - - type T @key(fields: "k") { - k: ID! - } - - enum link__Purpose { - """ - `SECURITY` features provide metadata necessary to securely resolve fields. - """ - SECURITY - """ - `EXECUTION` features provide metadata necessary for operation execution. - """ - EXECUTION - } - - scalar link__Import - - scalar federation__FieldSet - - scalar _Any - - type _Service { - sdl: String - } - - union _Entity = T - - type Query { - _entities(representations: [_Any!]!): [_Entity]! - _service: _Service! - } - "###); - } -}