Class: GraphQL::SchemaComparator::Changes::InputFieldRemoved

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(input_object_type, field) ⇒ InputFieldRemoved

Returns a new instance of InputFieldRemoved.



148
149
150
151
152
153
154
# File 'lib/graphql/schema_comparator/changes.rb', line 148

def initialize(input_object_type, field)
  @input_object_type = input_object_type
  @field = field
  @criticality = Changes::Criticality.breaking(
    reason: "Removing an input field will cause existing queries that use this input field to error."
  )
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



146
147
148
# File 'lib/graphql/schema_comparator/changes.rb', line 146

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field.



146
147
148
# File 'lib/graphql/schema_comparator/changes.rb', line 146

def field
  @field
end

#input_object_typeObject (readonly)

Returns the value of attribute input_object_type.



146
147
148
# File 'lib/graphql/schema_comparator/changes.rb', line 146

def input_object_type
  @input_object_type
end

Instance Method Details

#messageObject



156
157
158
# File 'lib/graphql/schema_comparator/changes.rb', line 156

def message
  "Input field `#{field.graphql_name}` was removed from input object type `#{input_object_type.graphql_name}`"
end

#pathObject



160
161
162
# File 'lib/graphql/schema_comparator/changes.rb', line 160

def path
  field.path
end