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_string: nil, line: nil, col: nil) ⇒ FragmentDefinition
constructor
A new instance of FragmentDefinition.
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_string: nil, line: nil, col: nil) ⇒ FragmentDefinition
Returns a new instance of FragmentDefinition.
423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/graphql/language/nodes.rb', line 423 def initialize(name: nil, type: nil, directives: NONE, selections: NONE, filename: nil, pos: nil, source_string: nil, line: nil, col: nil) @name = name @type = type @directives = directives @selections = selections @filename = filename @pos = pos @source_string = source_string @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 418
|
#type ⇒ String
Returns the type condition for this fragment (name of type which it may apply to).
423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/graphql/language/nodes.rb', line 423 def initialize(name: nil, type: nil, directives: NONE, selections: NONE, filename: nil, pos: nil, source_string: nil, line: nil, col: nil) @name = name @type = type @directives = directives @selections = selections @filename = filename @pos = pos @source_string = source_string @line = line @col = col end |
Class Method Details
.from_a(filename, line, col, name, type, directives, selections) ⇒ Object
435 436 437 |
# File 'lib/graphql/language/nodes.rb', line 435 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 |