Class: GraphQL::SchemaComparator::Changes::InputFieldAdded

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_object_type, field) ⇒ InputFieldAdded

Returns a new instance of InputFieldAdded.



711
712
713
714
715
# File 'lib/graphql/schema_comparator/changes.rb', line 711

def initialize(input_object_type, field)
  @input_object_type = input_object_type
  @field = field
  @breaking = field.type.kind.non_null? ? true : false
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



709
710
711
# File 'lib/graphql/schema_comparator/changes.rb', line 709

def field
  @field
end

#input_object_typeObject (readonly)

Returns the value of attribute input_object_type.



709
710
711
# File 'lib/graphql/schema_comparator/changes.rb', line 709

def input_object_type
  @input_object_type
end

Instance Method Details

#breaking?Boolean

Returns:

  • (Boolean)


721
722
723
# File 'lib/graphql/schema_comparator/changes.rb', line 721

def breaking?
  !!@breaking
end

#messageObject



717
718
719
# File 'lib/graphql/schema_comparator/changes.rb', line 717

def message
  "Input field `#{field.name}` was added to input object type `#{input_object_type.name}`"
end