pub struct SchemaDependencyGraph { /* private fields */ }Expand description
Schema dependency graph for analyzing type relationships.
This graph tracks which types depend on which other types, enabling:
- Circular dependency detection
- Unused type detection
- Impact analysis for schema changes
Implementations§
Source§impl SchemaDependencyGraph
impl SchemaDependencyGraph
Sourcepub fn find_cycles(&self) -> Vec<CyclePath>
pub fn find_cycles(&self) -> Vec<CyclePath>
Find all circular dependencies in the schema.
Returns a list of cycle paths. Each cycle is reported once, starting from the lexicographically smallest type name.
Sourcepub fn find_unused(&self) -> Vec<String>
pub fn find_unused(&self) -> Vec<String>
Find all types that have no incoming references (orphaned types).
Root types (Query, Mutation, Subscription) are excluded from this list as they are always considered used.
Sourcepub fn impact_of_deletion(&self, type_name: &str) -> ChangeImpact
pub fn impact_of_deletion(&self, type_name: &str) -> ChangeImpact
Analyze the impact of deleting a type from the schema.
Returns all types that would be affected (transitively) by removing the specified type.
Sourcepub fn transitive_dependencies(&self, type_name: &str) -> HashSet<String>
pub fn transitive_dependencies(&self, type_name: &str) -> HashSet<String>
Get transitive dependencies of a type (all types it depends on, recursively).
Sourcepub fn transitive_dependents(&self, type_name: &str) -> HashSet<String>
pub fn transitive_dependents(&self, type_name: &str) -> HashSet<String>
Get transitive dependents of a type (all types that depend on it, recursively).
Source§impl SchemaDependencyGraph
impl SchemaDependencyGraph
Sourcepub fn build(schema: &CompiledSchema) -> Self
pub fn build(schema: &CompiledSchema) -> Self
Build a dependency graph from a compiled schema.
This analyzes all types, queries, mutations, and subscriptions to build a complete dependency graph.
Source§impl SchemaDependencyGraph
impl SchemaDependencyGraph
Sourcepub fn dependencies_of(&self, type_name: &str) -> Vec<String>
pub fn dependencies_of(&self, type_name: &str) -> Vec<String>
Get all types that a given type depends on (outgoing edges).
Sourcepub fn dependents_of(&self, type_name: &str) -> Vec<String>
pub fn dependents_of(&self, type_name: &str) -> Vec<String>
Get all types that depend on a given type (incoming edges).
Sourcepub fn type_count(&self) -> usize
pub fn type_count(&self) -> usize
Get the total number of types in the graph.
Trait Implementations§
Source§impl Clone for SchemaDependencyGraph
impl Clone for SchemaDependencyGraph
Source§fn clone(&self) -> SchemaDependencyGraph
fn clone(&self) -> SchemaDependencyGraph
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SchemaDependencyGraph
impl RefUnwindSafe for SchemaDependencyGraph
impl Send for SchemaDependencyGraph
impl Sync for SchemaDependencyGraph
impl Unpin for SchemaDependencyGraph
impl UnsafeUnpin for SchemaDependencyGraph
impl UnwindSafe for SchemaDependencyGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more