pub struct IntrospectionResponses {
pub schema_response: Arc<Value>,
pub type_responses: HashMap<String, Arc<Value>>,
}Expand description
Pre-built introspection responses for fast serving.
Responses are stored as Arc<serde_json::Value> so cloning is O(1)
(introspection queries are frequent but the schema is immutable).
Fields§
§schema_response: Arc<Value>Full __schema response JSON.
type_responses: HashMap<String, Arc<Value>>Map of type name -> __type response JSON.
Implementations§
Source§impl IntrospectionResponses
impl IntrospectionResponses
Sourcepub fn build(schema: &CompiledSchema) -> Self
pub fn build(schema: &CompiledSchema) -> Self
Build introspection responses from compiled schema.
This is called once at server startup and cached.
Sourcepub fn filter_inaccessible(
&mut self,
inaccessible: &HashMap<String, Vec<String>>,
)
pub fn filter_inaccessible( &mut self, inaccessible: &HashMap<String, Vec<String>>, )
Filter @inaccessible fields from introspection responses.
Removes fields listed as inaccessible from both __type and __schema
responses. This is a DX defence-in-depth measure — Apollo Router uses
_service { sdl }, not live introspection, so hiding fields here protects
tooling that queries the subgraph directly.
Does NOT affect data responses or _entities results.
Sourcepub fn get_type_response(&self, type_name: &str) -> Value
pub fn get_type_response(&self, type_name: &str) -> Value
Get response for __type(name: "...") query.
Trait Implementations§
Source§impl Clone for IntrospectionResponses
impl Clone for IntrospectionResponses
Source§fn clone(&self) -> IntrospectionResponses
fn clone(&self) -> IntrospectionResponses
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more