Class: GraphQL::DSL::InlineFragment
- Includes:
- SelectionSet
- Defined in:
- lib/graphql/dsl/nodes/inline_fragment.rb
Overview
Inline fragment GraphQL node
Instance Attribute Summary collapse
-
#__directives ⇒ Array<Directive>
readonly
List of directives.
-
#__type ⇒ String, ...
readonly
Inline fragment type or interface.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(type = nil, directives = [], &block) ⇒ InlineFragment
constructor
Create inline fragment.
Methods included from SelectionSet
#__field, #__fragment, #__inline_fragment
Methods inherited from Node
Constructor Details
#initialize(type = nil, directives = [], &block) ⇒ InlineFragment
Create inline fragment
24 25 26 27 28 29 30 31 |
# File 'lib/graphql/dsl/nodes/inline_fragment.rb', line 24 def initialize(type = nil, directives = [], &block) raise Error, 'Sub-fields must be specified for inline fragment' if block.nil? @__type = type @__directives = directives.map { |directive| Directive.from(directive) } super(nil, &block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GraphQL::DSL::SelectionSet
Instance Attribute Details
#__directives ⇒ Array<Directive> (readonly)
Returns list of directives.
16 17 18 |
# File 'lib/graphql/dsl/nodes/inline_fragment.rb', line 16 def __directives @__directives end |
#__type ⇒ String, ... (readonly)
Returns inline fragment type or interface.
12 13 14 |
# File 'lib/graphql/dsl/nodes/inline_fragment.rb', line 12 def __type @__type end |