Class: GraphQL::Language::Nodes::FieldDefinition

Inherits:
AbstractNode
  • Object
show all
Defined in:
lib/graphql/language/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #filename, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

#eql?, #initialize, #position, #to_query_string

Constructor Details

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



455
456
457
# File 'lib/graphql/language/nodes.rb', line 455

def arguments
  @arguments
end

#descriptionObject

Returns the value of attribute description.



455
456
457
# File 'lib/graphql/language/nodes.rb', line 455

def description
  @description
end

#directivesObject

Returns the value of attribute directives.



455
456
457
# File 'lib/graphql/language/nodes.rb', line 455

def directives
  @directives
end

#nameObject

Returns the value of attribute name.



455
456
457
# File 'lib/graphql/language/nodes.rb', line 455

def name
  @name
end

#typeObject

Returns the value of attribute type.



455
456
457
# File 'lib/graphql/language/nodes.rb', line 455

def type
  @type
end

Instance Method Details

#childrenObject



465
466
467
# File 'lib/graphql/language/nodes.rb', line 465

def children
  arguments + directives
end

#initialize_node(name:, arguments:, type:, directives: [], description: nil) ⇒ Object



457
458
459
460
461
462
463
# File 'lib/graphql/language/nodes.rb', line 457

def initialize_node(name:, arguments:, type:, directives: [], description: nil)
  @name = name
  @arguments = arguments
  @type = type
  @directives = directives
  @description = description
end

#scalarsObject



469
470
471
# File 'lib/graphql/language/nodes.rb', line 469

def scalars
  [name, type]
end