From ea5cbfdfab0321aee38e64e26e7f21e4ce071db1 Mon Sep 17 00:00:00 2001 From: Paul Nguyen Date: Mon, 2 May 2022 18:12:06 +0200 Subject: [PATCH] Remove obsolete `disable_introspection` field in `Request` --- src/request.rs | 14 +------------- src/schema.rs | 6 +----- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/request.rs b/src/request.rs index 97832857..b594b4c5 100644 --- a/src/request.rs +++ b/src/request.rs @@ -47,13 +47,6 @@ pub struct Request { #[serde(default)] pub extensions: HashMap, - /// Disable introspection queries for this request. - /// This option has priority over `introspection_mode` when set to true. - /// `introspection_mode` has priority when `disable_introspection` set to - /// `false`. - #[serde(skip)] - pub disable_introspection: bool, - #[serde(skip)] pub(crate) parsed_query: Option, @@ -73,7 +66,6 @@ impl Request { uploads: Vec::default(), data: Data::default(), extensions: Default::default(), - disable_introspection: false, parsed_query: None, introspection_mode: IntrospectionMode::Enabled, } @@ -104,7 +96,6 @@ impl Request { /// Disable introspection queries for this request. #[must_use] pub fn disable_introspection(mut self) -> Self { - self.disable_introspection = true; self.introspection_mode = IntrospectionMode::Disabled; self } @@ -112,7 +103,6 @@ impl Request { /// Only allow introspection queries for this request. #[must_use] pub fn only_introspection(mut self) -> Self { - self.disable_introspection = false; self.introspection_mode = IntrospectionMode::IntrospectionOnly; self } @@ -252,11 +242,10 @@ impl BatchRequest { self } - /// Disable introspection queries for for each requests. + /// Disable introspection queries for each request. #[must_use] pub fn disable_introspection(mut self) -> Self { for request in self.iter_mut() { - request.disable_introspection = true; request.introspection_mode = IntrospectionMode::Disabled; } self @@ -266,7 +255,6 @@ impl BatchRequest { #[must_use] pub fn introspection_only(mut self) -> Self { for request in self.iter_mut() { - request.disable_introspection = false; request.introspection_mode = IntrospectionMode::IntrospectionOnly; } self diff --git a/src/schema.rs b/src/schema.rs index 602ebab7..43f86cd9 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -545,11 +545,7 @@ where session_data, ctx_data: query_data, http_headers: Default::default(), - introspection_mode: if request.disable_introspection { - IntrospectionMode::Disabled - } else { - request.introspection_mode - }, + introspection_mode: request.introspection_mode, errors: Default::default(), }; Ok((QueryEnv::new(env), validation_result.cache_control))