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?, #path

Constructor Details

#initialize(directive, argument) ⇒ DirectiveArgumentAdded

Returns a new instance of DirectiveArgumentAdded.



997
998
999
1000
1001
1002
1003
1004
1005
# File 'lib/graphql/schema_comparator/changes.rb', line 997

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.



995
996
997
# File 'lib/graphql/schema_comparator/changes.rb', line 995

def argument
  @argument
end

#criticalityObject (readonly)

Returns the value of attribute criticality.



995
996
997
# File 'lib/graphql/schema_comparator/changes.rb', line 995

def criticality
  @criticality
end

#directiveObject (readonly)

Returns the value of attribute directive.



995
996
997
# File 'lib/graphql/schema_comparator/changes.rb', line 995

def directive
  @directive
end

Instance Method Details

#messageObject



1007
1008
1009
# File 'lib/graphql/schema_comparator/changes.rb', line 1007

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