Class: GraphQL::SchemaComparator::Changes::RootOperationTypeAdded
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::RootOperationTypeAdded
- 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.
-
#operation_type ⇒ Object
readonly
Returns the value of attribute operation_type.
Instance Method Summary collapse
-
#initialize(new_schema:, operation_type:) ⇒ RootOperationTypeAdded
constructor
A new instance of RootOperationTypeAdded.
- #message ⇒ Object
- #operation_type_name ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(new_schema:, operation_type:) ⇒ RootOperationTypeAdded
Returns a new instance of RootOperationTypeAdded.
207 208 209 210 211 212 213 |
# File 'lib/graphql/schema_comparator/changes.rb', line 207 def initialize(new_schema:, operation_type:) @new_schema = new_schema @operation_type = operation_type @criticality = Changes::Criticality.non_breaking( reason: "Adding a schema #{operation_type} root is considered non-breaking." ) end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
205 206 207 |
# File 'lib/graphql/schema_comparator/changes.rb', line 205 def criticality @criticality end |
#new_schema ⇒ Object (readonly)
Returns the value of attribute new_schema.
205 206 207 |
# File 'lib/graphql/schema_comparator/changes.rb', line 205 def new_schema @new_schema end |
#operation_type ⇒ Object (readonly)
Returns the value of attribute operation_type.
205 206 207 |
# File 'lib/graphql/schema_comparator/changes.rb', line 205 def operation_type @operation_type end |
Instance Method Details
#message ⇒ Object
215 216 217 |
# File 'lib/graphql/schema_comparator/changes.rb', line 215 def "Schema #{operation_type} root `#{operation_type_name}` was added" end |
#operation_type_name ⇒ Object
223 224 225 226 227 228 229 230 231 232 |
# File 'lib/graphql/schema_comparator/changes.rb', line 223 def operation_type_name case operation_type when :query new_schema.query.graphql_name when :mutation new_schema.mutation.graphql_name when :subscription new_schema.subscription.graphql_name end end |
#path ⇒ Object
219 220 221 |
# File 'lib/graphql/schema_comparator/changes.rb', line 219 def path operation_type_name end |