Class: GraphWeaver::Codegen::ObjectNode
- Defined in:
- lib/graph_weaver/codegen/nodes.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#aliases ⇒ Object
the GraphQL type this struct was generated from, any registered helper modules to include, and any resolved alias delegators (see extend_type).
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#graphql_type ⇒ Object
the GraphQL type this struct was generated from, any registered helper modules to include, and any resolved alias delegators (see extend_type).
-
#mixins ⇒ Object
the GraphQL type this struct was generated from, any registered helper modules to include, and any resolved alias delegators (see extend_type).
Instance Method Summary collapse
- #bare_type ⇒ Object
- #cast(expr, _depth) ⇒ Object
-
#initialize(class_name) ⇒ ObjectNode
constructor
A new instance of ObjectNode.
- #nested ⇒ Object
Methods inherited from Node
#coerce?, #hash_coerce_identity?, #identity?, #non_null?, #prop_type, #serialize_identity?
Constructor Details
#initialize(class_name) ⇒ ObjectNode
Returns a new instance of ObjectNode.
156 157 158 159 160 161 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 156 def initialize(class_name) @class_name = class_name @fields = [] @mixins = [] @aliases = [] end |
Instance Attribute Details
#aliases ⇒ Object
the GraphQL type this struct was generated from, any registered helper modules to include, and any resolved alias delegators (see extend_type)
154 155 156 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 154 def aliases @aliases end |
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
151 152 153 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 151 def class_name @class_name end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
151 152 153 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 151 def fields @fields end |
#graphql_type ⇒ Object
the GraphQL type this struct was generated from, any registered helper modules to include, and any resolved alias delegators (see extend_type)
154 155 156 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 154 def graphql_type @graphql_type end |
#mixins ⇒ Object
the GraphQL type this struct was generated from, any registered helper modules to include, and any resolved alias delegators (see extend_type)
154 155 156 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 154 def mixins @mixins end |
Instance Method Details
#bare_type ⇒ Object
163 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 163 def = class_name |
#cast(expr, _depth) ⇒ Object
165 166 167 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 165 def cast(expr, _depth) "#{class_name}.from_h(#{expr})" end |
#nested ⇒ Object
169 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 169 def nested = self |