Class: GraphQL::SchemaComparator::Result
- Inherits:
-
Object
- Object
- GraphQL::SchemaComparator::Result
- Defined in:
- lib/graphql/schema_comparator/result.rb
Overview
The result of a comparison between two schema versions
Instance Attribute Summary collapse
-
#breaking_changes ⇒ Object
readonly
Returns the value of attribute breaking_changes.
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#dangerous_changes ⇒ Object
readonly
Returns the value of attribute dangerous_changes.
-
#non_breaking_changes ⇒ Object
readonly
Returns the value of attribute non_breaking_changes.
Instance Method Summary collapse
-
#breaking? ⇒ Boolean
If there was a breaking change between the two schema versions.
-
#identical? ⇒ Boolean
If the two schemas were identical.
-
#initialize(changes) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(changes) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 12 |
# File 'lib/graphql/schema_comparator/result.rb', line 7 def initialize(changes) @changes = changes.sort_by(&:criticality).reverse @breaking_changes = @changes.select(&:breaking?) @non_breaking_changes = @changes.select(&:non_breaking?) @dangerous_changes = @changes.select(&:dangerous?) end |
Instance Attribute Details
#breaking_changes ⇒ Object (readonly)
Returns the value of attribute breaking_changes.
5 6 7 |
# File 'lib/graphql/schema_comparator/result.rb', line 5 def breaking_changes @breaking_changes end |
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
5 6 7 |
# File 'lib/graphql/schema_comparator/result.rb', line 5 def changes @changes end |
#dangerous_changes ⇒ Object (readonly)
Returns the value of attribute dangerous_changes.
5 6 7 |
# File 'lib/graphql/schema_comparator/result.rb', line 5 def dangerous_changes @dangerous_changes end |
#non_breaking_changes ⇒ Object (readonly)
Returns the value of attribute non_breaking_changes.
5 6 7 |
# File 'lib/graphql/schema_comparator/result.rb', line 5 def non_breaking_changes @non_breaking_changes end |
Instance Method Details
#breaking? ⇒ Boolean
If there was a breaking change between the two schema versions
22 23 24 |
# File 'lib/graphql/schema_comparator/result.rb', line 22 def breaking? breaking_changes.any? end |
#identical? ⇒ Boolean
If the two schemas were identical
16 17 18 |
# File 'lib/graphql/schema_comparator/result.rb', line 16 def identical? @changes.empty? end |