Class: GraphQL::SchemaComparator::Changes::ObjectTypeInterfaceRemoved

Inherits:
AbstractChange
  • Object
show all
Defined in:
lib/graphql/schema_comparator/changes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractChange

#breaking?, #dangerous?, #non_breaking?

Constructor Details

#initialize(interface, object_type) ⇒ ObjectTypeInterfaceRemoved

Returns a new instance of ObjectTypeInterfaceRemoved.



343
344
345
346
347
348
349
# File 'lib/graphql/schema_comparator/changes.rb', line 343

def initialize(interface, object_type)
  @interface = interface
  @object_type = object_type
  @criticality = Changes::Criticality.breaking(
    reason: "Removing an interface from an object type can cause existing queries that use this in a fragment spread to error."
  )
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



341
342
343
# File 'lib/graphql/schema_comparator/changes.rb', line 341

def criticality
  @criticality
end

#interfaceObject (readonly)

Returns the value of attribute interface.



341
342
343
# File 'lib/graphql/schema_comparator/changes.rb', line 341

def interface
  @interface
end

#object_typeObject (readonly)

Returns the value of attribute object_type.



341
342
343
# File 'lib/graphql/schema_comparator/changes.rb', line 341

def object_type
  @object_type
end

Instance Method Details

#messageObject



351
352
353
# File 'lib/graphql/schema_comparator/changes.rb', line 351

def message
  "`#{object_type.graphql_name}` object type no longer implements `#{interface.graphql_name}` interface"
end

#pathObject



355
356
357
# File 'lib/graphql/schema_comparator/changes.rb', line 355

def path
  object_type.path
end