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
Methods inherited from AbstractNode
#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string
Constructor Details
This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode
Instance Attribute Details
#name ⇒ String
Returns the identifier for this fragment, which may be applied with ...#{name}
.
|
# File 'lib/graphql/language/nodes.rb', line 387
|
#type ⇒ String
Returns the type condition for this fragment (name of type which it may apply to).
392 393 394 395 396 397 |
# File 'lib/graphql/language/nodes.rb', line 392 def initialize_node(name: nil, type: nil, directives: [], selections: []) @name = name @type = type @directives = directives @selections = selections end |
Class Method Details
.from_a(filename, line, col, name, type, directives, selections) ⇒ Object
399 400 401 |
# File 'lib/graphql/language/nodes.rb', line 399 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
#initialize_node(name: nil, type: nil, directives: [], selections: []) ⇒ Object
392 393 394 395 396 397 |
# File 'lib/graphql/language/nodes.rb', line 392 def initialize_node(name: nil, type: nil, directives: [], selections: []) @name = name @type = type @directives = directives @selections = selections end |