Class: GraphQL::DSL::FragmentOperation
- Includes:
- SelectionSet
- Defined in:
- lib/graphql/dsl/nodes/fragment_operation.rb
Overview
Fragment operation GraphQL node
Instance Attribute Summary collapse
-
#__directives ⇒ Array<Directive>
readonly
List of directives.
-
#__type ⇒ String, Symbol
readonly
Fragment type or interface.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(name, type, directives = [], &block) ⇒ FragmentOperation
constructor
Create fragment operation.
Methods included from SelectionSet
#__field, #__fragment, #__inline_fragment
Methods inherited from Node
Constructor Details
#initialize(name, type, directives = [], &block) ⇒ FragmentOperation
Create fragment operation
25 26 27 28 29 30 31 32 33 |
# File 'lib/graphql/dsl/nodes/fragment_operation.rb', line 25 def initialize(name, type, directives = [], &block) raise Error, '`name` must be specified' if name.nil? || name.empty? raise Error, '`type` must be specified' if type.nil? || type.empty? @__type = type @__directives = directives.map { |directive| Directive.from(directive) } super(name, &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/fragment_operation.rb', line 16 def __directives @__directives end |
#__type ⇒ String, Symbol (readonly)
Returns fragment type or interface.
12 13 14 |
# File 'lib/graphql/dsl/nodes/fragment_operation.rb', line 12 def __type @__type end |