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.
Instance Attribute Summary collapse
-
#directives ⇒ Object
Returns the value of attribute directives.
-
#name ⇒ String
The identifier for this fragment, which may be applied with
...#{name}
. -
#selections ⇒ Object
Returns the value of attribute selections.
-
#type ⇒ String
The type condition for this fragment (name of type which it may apply to).
Attributes inherited from AbstractNode
Instance Method Summary collapse
-
#children ⇒ Object
-
#initialize_node(name: nil, type: nil, directives: [], selections: []) ⇒ Object
-
#scalars ⇒ Object
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
#directives ⇒ Object
Returns the value of attribute directives
215 216 217 |
# File 'lib/graphql/language/nodes.rb', line 215 def directives @directives end |
#name ⇒ String
Returns the identifier for this fragment, which may be applied with ...#{name}
217 218 219 |
# File 'lib/graphql/language/nodes.rb', line 217 def name @name end |
#selections ⇒ Object
Returns the value of attribute selections
215 216 217 |
# File 'lib/graphql/language/nodes.rb', line 215 def selections @selections end |
#type ⇒ String
Returns the type condition for this fragment (name of type which it may apply to)
222 223 224 |
# File 'lib/graphql/language/nodes.rb', line 222 def type @type end |
Instance Method Details
#children ⇒ Object
229 230 231 |
# File 'lib/graphql/language/nodes.rb', line 229 def children directives + selections end |
#initialize_node(name: nil, type: nil, directives: [], selections: []) ⇒ Object
222 223 224 225 226 227 |
# File 'lib/graphql/language/nodes.rb', line 222 def initialize_node(name: nil, type: nil, directives: [], selections: []) @name = name @type = type @directives = directives @selections = selections end |
#scalars ⇒ Object
233 234 235 |
# File 'lib/graphql/language/nodes.rb', line 233 def scalars [name, type] end |