From 95b4e613b1d8ffab388e9e43a032f814c18f3d57 Mon Sep 17 00:00:00 2001 From: aidan coyne Date: Sun, 4 Sep 2022 11:30:06 -0500 Subject: [PATCH] clean up some mistakes, ensure existing tests pass --- src/registry/export_sdl.rs | 8 ++++---- src/registry/mod.rs | 5 ----- src/schema.rs | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs index d8ad4f26..be38f43b 100644 --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -113,10 +113,10 @@ impl Registry { if options.federation { if self.enable_apollo_link { - writeln!("extend schema @link(").ok(); - writelin!("\turl: \"https://specs.apollo.dev/federation/v2.0\",").ok(); - writeln!("\timport: [\"@key\", \"@tag\", \"@shareable\", \"@inaccessible\", \"@override\", \"@external\", \"@provides\", \"@requires\"]").ok(); - writeln!(")").ok(); + writeln!(sdl, "extend schema @link(").ok(); + writeln!(sdl, "\turl: \"https://specs.apollo.dev/federation/v2.0\",").ok(); + writeln!(sdl, "\timport: [\"@key\", \"@tag\", \"@shareable\", \"@inaccessible\", \"@override\", \"@external\", \"@provides\", \"@requires\"]").ok(); + writeln!(sdl, ")").ok(); } } else { writeln!(sdl, "schema {{").ok(); diff --git a/src/registry/mod.rs b/src/registry/mod.rs index 88abf48a..5a6e6f34 100644 --- a/src/registry/mod.rs +++ b/src/registry/mod.rs @@ -413,11 +413,6 @@ pub struct MetaDirective { pub visible: Option, } -#[derive(Debug, Clone)] -pub struct ApolloLinkConfig { - pub extend_schema: bool, -} - #[derive(Default)] pub struct Registry { pub types: BTreeMap, diff --git a/src/schema.rs b/src/schema.rs index f17b6de0..7c54689b 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -30,7 +30,6 @@ use crate::{ InputType, ObjectType, OutputType, QueryEnv, Request, Response, ServerError, ServerResult, SubscriptionType, Variables, ID, }; -use crate::registry::ApolloLinkConfig; /// Introspection mode #[derive(Debug, Copy, Clone, PartialEq, Eq)] @@ -389,6 +388,7 @@ where }, introspection_mode: IntrospectionMode::Enabled, enable_federation: false, + enable_apollo_link: false, federation_subscription: false, ignore_name_conflicts, };