Class: GraphQL::DSL::Field
- Includes:
- SelectionSet
- Defined in:
- lib/graphql/dsl/nodes/field.rb
Overview
Field GraphQL node
Instance Attribute Summary collapse
-
#__alias ⇒ String, ...
readonly
Field alias.
-
#__arguments ⇒ Hash
readonly
List of filed arguments.
-
#__directives ⇒ Array<Directive>
readonly
List of directives.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(field_name, field_alias = nil, arguments = {}, directives = [], &block) ⇒ Field
constructor
Create field.
Methods included from SelectionSet
#__field, #__fragment, #__inline_fragment
Methods inherited from Node
Constructor Details
#initialize(field_name, field_alias = nil, arguments = {}, directives = [], &block) ⇒ Field
Create field
30 31 32 33 34 35 36 |
# File 'lib/graphql/dsl/nodes/field.rb', line 30 def initialize(field_name, field_alias = nil, arguments = {}, directives = [], &block) @__alias = field_alias @__arguments = arguments @__directives = directives.map { |directive| Directive.from(directive) } super(field_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
#__alias ⇒ String, ... (readonly)
Returns field alias.
12 13 14 |
# File 'lib/graphql/dsl/nodes/field.rb', line 12 def __alias @__alias end |
#__arguments ⇒ Hash (readonly)
Returns list of filed arguments.
16 17 18 |
# File 'lib/graphql/dsl/nodes/field.rb', line 16 def __arguments @__arguments end |
#__directives ⇒ Array<Directive> (readonly)
Returns list of directives.
20 21 22 |
# File 'lib/graphql/dsl/nodes/field.rb', line 20 def __directives @__directives end |