Class: GraphQL::SchemaComparator::Changes::FieldArgumentRemoved

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, argument) ⇒ FieldArgumentRemoved

Returns a new instance of FieldArgumentRemoved.



168
169
170
171
172
173
174
175
# File 'lib/graphql/schema_comparator/changes.rb', line 168

def initialize(object_type, field, argument)
  @object_type = object_type
  @field = field
  @argument = argument
  @criticality = Changes::Criticality.breaking(
    reason: "Removing a field argument is a breaking change because it will cause existing queries that use this argument to error."
  )
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



166
167
168
# File 'lib/graphql/schema_comparator/changes.rb', line 166

def argument
  @argument
end

#criticalityObject (readonly)

Returns the value of attribute criticality.



166
167
168
# File 'lib/graphql/schema_comparator/changes.rb', line 166

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field.



166
167
168
# File 'lib/graphql/schema_comparator/changes.rb', line 166

def field
  @field
end

#object_typeObject (readonly)

Returns the value of attribute object_type.



166
167
168
# File 'lib/graphql/schema_comparator/changes.rb', line 166

def object_type
  @object_type
end

Instance Method Details

#messageObject



177
178
179
# File 'lib/graphql/schema_comparator/changes.rb', line 177

def message
  "Argument `#{argument.graphql_name}: #{argument.type.to_type_signature}` was removed from field `#{object_type.graphql_name}.#{field.graphql_name}`"
end

#pathObject



181
182
183
# File 'lib/graphql/schema_comparator/changes.rb', line 181

def path
  argument.path
end