Class: GraphQL::SchemaComparator::Changes::RootOperationTypeChanged
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::RootOperationTypeChanged
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#new_schema ⇒ Object
readonly
Returns the value of attribute new_schema.
-
#old_schema ⇒ Object
readonly
Returns the value of attribute old_schema.
-
#operation_type ⇒ Object
readonly
Returns the value of attribute operation_type.
Instance Method Summary collapse
-
#initialize(old_schema:, new_schema:, operation_type:) ⇒ RootOperationTypeChanged
constructor
A new instance of RootOperationTypeChanged.
- #message ⇒ Object
- #operation_type_name(schema) ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(old_schema:, new_schema:, operation_type:) ⇒ RootOperationTypeChanged
Returns a new instance of RootOperationTypeChanged.
238 239 240 241 242 243 |
# File 'lib/graphql/schema_comparator/changes.rb', line 238 def initialize(old_schema:, new_schema:, operation_type:) @old_schema = old_schema @new_schema = new_schema @operation_type = operation_type @criticality = Changes::Criticality.breaking end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
236 237 238 |
# File 'lib/graphql/schema_comparator/changes.rb', line 236 def criticality @criticality end |
#new_schema ⇒ Object (readonly)
Returns the value of attribute new_schema.
236 237 238 |
# File 'lib/graphql/schema_comparator/changes.rb', line 236 def new_schema @new_schema end |
#old_schema ⇒ Object (readonly)
Returns the value of attribute old_schema.
236 237 238 |
# File 'lib/graphql/schema_comparator/changes.rb', line 236 def old_schema @old_schema end |
#operation_type ⇒ Object (readonly)
Returns the value of attribute operation_type.
236 237 238 |
# File 'lib/graphql/schema_comparator/changes.rb', line 236 def operation_type @operation_type end |
Instance Method Details
#message ⇒ Object
245 246 247 |
# File 'lib/graphql/schema_comparator/changes.rb', line 245 def "Schema #{operation_type} root has changed from `#{operation_type_name(old_schema)}` to `#{operation_type_name(new_schema)}`" end |
#operation_type_name(schema) ⇒ Object
253 254 255 256 257 258 259 260 261 262 |
# File 'lib/graphql/schema_comparator/changes.rb', line 253 def operation_type_name(schema) case operation_type when :query schema.query.graphql_name when :mutation schema.mutation.graphql_name when :subscription schema.subscription.graphql_name end end |
#path ⇒ Object
249 250 251 |
# File 'lib/graphql/schema_comparator/changes.rb', line 249 def path operation_type_name(old_schema) end |