Class: GraphQL::Language::Nodes::FragmentDefinition
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::FragmentDefinition
- Defined in:
- lib/graphql/language/nodes.rb
Overview
A reusable fragment, defined at document-level.
Constant Summary
Constants inherited from AbstractNode
Instance Attribute Summary collapse
-
#name ⇒ String
The identifier for this fragment, which may be applied with
...#{name}
. -
#type ⇒ String
The type condition for this fragment (name of type which it may apply to).
Attributes inherited from AbstractNode
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name: nil, type: nil, directives: NONE, selections: NONE, filename: nil, pos: nil, source: nil, line: nil, col: nil) ⇒ FragmentDefinition
constructor
A new instance of FragmentDefinition.
-
#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, type: nil, directives: NONE, selections: NONE, filename: nil, pos: nil, source: nil, line: nil, col: nil) ⇒ FragmentDefinition
Returns a new instance of FragmentDefinition.
449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/graphql/language/nodes.rb', line 449 def initialize(name: nil, type: nil, directives: NONE, selections: NONE, filename: nil, pos: nil, source: nil, line: nil, col: nil) @name = name @type = type @directives = directives @selections = selections @filename = filename @pos = pos @source = source @line = line @col = col end |
Instance Attribute Details
#name ⇒ String
Returns the identifier for this fragment, which may be applied with ...#{name}
.
|
# File 'lib/graphql/language/nodes.rb', line 444
|
#type ⇒ String
Returns the type condition for this fragment (name of type which it may apply to).
449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/graphql/language/nodes.rb', line 449 def initialize(name: nil, type: nil, directives: NONE, selections: NONE, filename: nil, pos: nil, source: nil, line: nil, col: nil) @name = name @type = type @directives = directives @selections = selections @filename = filename @pos = pos @source = source @line = line @col = col end |
Class Method Details
.from_a(filename, line, col, name, type, directives, selections) ⇒ Object
461 462 463 |
# File 'lib/graphql/language/nodes.rb', line 461 def self.from_a(filename, line, col, name, type, directives, selections) self.new(filename: filename, line: line, col: col, name: name, type: type, directives: directives, selections: selections) end |
Instance Method Details
#marshal_dump ⇒ Object
465 466 467 |
# File 'lib/graphql/language/nodes.rb', line 465 def marshal_dump [line, col, @filename, @name, @type, @directives, @selections] end |
#marshal_load(values) ⇒ Object
469 470 471 |
# File 'lib/graphql/language/nodes.rb', line 469 def marshal_load(values) @line, @col, @filename, @name, @type, @directives, @selections = values end |