Class: GraphQL::SchemaComparator::Changes::DirectiveArgumentAdded

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(directive, argument) ⇒ DirectiveArgumentAdded

Returns a new instance of DirectiveArgumentAdded.



837
838
839
840
841
842
843
844
845
# File 'lib/graphql/schema_comparator/changes.rb', line 837

def initialize(directive, argument)
  @criticality = if argument.type.non_null?
    Changes::Criticality.breaking
  else
    Changes::Criticality.non_breaking
  end
  @directive = directive
  @argument = argument
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



835
836
837
# File 'lib/graphql/schema_comparator/changes.rb', line 835

def argument
  @argument
end

#criticalityObject (readonly)

Returns the value of attribute criticality.



835
836
837
# File 'lib/graphql/schema_comparator/changes.rb', line 835

def criticality
  @criticality
end

#directiveObject (readonly)

Returns the value of attribute directive.



835
836
837
# File 'lib/graphql/schema_comparator/changes.rb', line 835

def directive
  @directive
end

Instance Method Details

#messageObject



847
848
849
# File 'lib/graphql/schema_comparator/changes.rb', line 847

def message
  "Argument `#{argument.name}` was added to directive `#{directive.name}`"
end