Class: GraphQL::StaticValidation::DefinitionDependencies::DependencyMap
- Inherits:
-
Object
- Object
- GraphQL::StaticValidation::DefinitionDependencies::DependencyMap
- Defined in:
- lib/graphql/static_validation/definition_dependencies.rb
Overview
Map definition AST nodes to the definition AST nodes they depend on. Expose circular dependencies.
Instance Attribute Summary collapse
-
#cyclical_definitions ⇒ Array<GraphQL::Language::Nodes::FragmentDefinition>
readonly
-
#unmet_dependencies ⇒ Hash<Node, Array<GraphQL::Language::Nodes::FragmentSpread>>
readonly
-
#unused_dependencies ⇒ Array<GraphQL::Language::Nodes::FragmentDefinition>
readonly
Instance Method Summary collapse
-
#[](definition_node) ⇒ Array<GraphQL::Language::Nodes::AbstractNode>
Dependencies for
definition_node
. -
#initialize ⇒ DependencyMap
constructor
A new instance of DependencyMap.
Constructor Details
#initialize ⇒ DependencyMap
Returns a new instance of DependencyMap.
86 87 88 89 90 91 |
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 86 def initialize @dependencies = Hash.new { |h, k| h[k] = [] } @cyclical_definitions = [] @unmet_dependencies = Hash.new { |h, k| h[k] = [] } @unused_dependencies = [] end |
Instance Attribute Details
#cyclical_definitions ⇒ Array<GraphQL::Language::Nodes::FragmentDefinition> (readonly)
78 79 80 |
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 78 def cyclical_definitions @cyclical_definitions end |
#unmet_dependencies ⇒ Hash<Node, Array<GraphQL::Language::Nodes::FragmentSpread>> (readonly)
81 82 83 |
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 81 def unmet_dependencies @unmet_dependencies end |
#unused_dependencies ⇒ Array<GraphQL::Language::Nodes::FragmentDefinition> (readonly)
84 85 86 |
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 84 def unused_dependencies @unused_dependencies end |
Instance Method Details
#[](definition_node) ⇒ Array<GraphQL::Language::Nodes::AbstractNode>
Returns dependencies for definition_node
.
94 95 96 |
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 94 def [](definition_node) @dependencies[definition_node] end |