Class: GraphQL::Language::Nodes::Field
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::Field
- Defined in:
- lib/graphql/language/nodes.rb
Overview
A single selection in a GraphQL query.
Constant Summary
Constants inherited from AbstractNode
Instance Attribute Summary
Attributes inherited from AbstractNode
Class Method Summary collapse
-
.from_a(filename, line, col, field_alias, name, arguments, directives, selections) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Summary collapse
-
#initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ Field
constructor
A new instance of Field.
-
#marshal_dump ⇒ Object
-
#marshal_load(values) ⇒ Object
Methods inherited from AbstractNode
#==, #children, #children_method_name, children_of_type, #col, #definition_line, #delete_child, inherited, #initialize_copy, #line, #merge, #position, #replace_child, #scalars, #to_query_string
Constructor Details
#initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ Field
Returns a new instance of Field.
405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/graphql/language/nodes.rb', line 405 def initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) @name = name @arguments = arguments || NONE @directives = directives || NONE @selections = selections || NONE # oops, alias is a keyword: @alias = field_alias @line = line @col = col @pos = pos @filename = filename @source = source end |
Class Method Details
.from_a(filename, line, col, field_alias, name, arguments, directives, selections) ⇒ Object
rubocop:disable Metrics/ParameterLists
419 420 421 |
# File 'lib/graphql/language/nodes.rb', line 419 def self.from_a(filename, line, col, field_alias, name, arguments, directives, selections) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, field_alias: field_alias, name: name, arguments: arguments, directives: directives, selections: selections) end |
Instance Method Details
#marshal_dump ⇒ Object
423 424 425 |
# File 'lib/graphql/language/nodes.rb', line 423 def marshal_dump [line, col, @filename, @name, @arguments, @directives, @selections, @alias] end |
#marshal_load(values) ⇒ Object
427 428 429 |
# File 'lib/graphql/language/nodes.rb', line 427 def marshal_load(values) @line, @col, @filename, @name, @arguments, @directives, @selections, @alias = values end |