Class: GraphQL::SchemaComparator::Changes::ObjectTypeInterfaceAdded

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) ⇒ ObjectTypeInterfaceAdded


429
430
431
432
433
434
435
436
# File 'lib/graphql/schema_comparator/changes.rb', line 429

def initialize(interface, object_type)
  @criticality = Changes::Criticality.dangerous(
    reason: "Adding an interface to an object type may break existing clients " \
      "that were not programming defensively against a new possible type."
  )
  @interface = interface
  @object_type = object_type
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality


427
428
429
# File 'lib/graphql/schema_comparator/changes.rb', line 427

def criticality
  @criticality
end

#interfaceObject (readonly)

Returns the value of attribute interface


427
428
429
# File 'lib/graphql/schema_comparator/changes.rb', line 427

def interface
  @interface
end

#object_typeObject (readonly)

Returns the value of attribute object_type


427
428
429
# File 'lib/graphql/schema_comparator/changes.rb', line 427

def object_type
  @object_type
end

Instance Method Details

#messageObject


438
439
440
# File 'lib/graphql/schema_comparator/changes.rb', line 438

def message
  "`#{object_type.name}` object implements `#{interface.name}` interface"
end