Class: GraphQL::SchemaComparator::Changes::FieldAdded

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(object_type, field) ⇒ FieldAdded

Returns a new instance of FieldAdded.



896
897
898
899
900
# File 'lib/graphql/schema_comparator/changes.rb', line 896

def initialize(object_type, field)
  @criticality = Changes::Criticality.non_breaking
  @object_type = object_type
  @field = field
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



894
895
896
# File 'lib/graphql/schema_comparator/changes.rb', line 894

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field.



894
895
896
# File 'lib/graphql/schema_comparator/changes.rb', line 894

def field
  @field
end

#object_typeObject (readonly)

Returns the value of attribute object_type.



894
895
896
# File 'lib/graphql/schema_comparator/changes.rb', line 894

def object_type
  @object_type
end

Instance Method Details

#messageObject



902
903
904
# File 'lib/graphql/schema_comparator/changes.rb', line 902

def message
  "Field `#{field.graphql_name}` was added to object type `#{object_type.graphql_name}`"
end

#pathObject



906
907
908
# File 'lib/graphql/schema_comparator/changes.rb', line 906

def path
  [object_type.graphql_name, field.graphql_name].join(".")
end