Class: GraphWeaver::Codegen::ObjectNode
- Defined in:
- lib/graph_weaver/codegen/nodes.rb
Defined Under Namespace
Classes: Field
Instance Attribute Summary collapse
-
#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, and any registered helper modules to include (see Codegen.register_type).
-
#mixins ⇒ Object
the GraphQL type this struct was generated from, and any registered helper modules to include (see Codegen.register_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.
153 154 155 156 157 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 153 def initialize(class_name) @class_name = class_name @fields = [] @mixins = [] end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
148 149 150 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 148 def class_name @class_name end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
148 149 150 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 148 def fields @fields end |
#graphql_type ⇒ Object
the GraphQL type this struct was generated from, and any registered helper modules to include (see Codegen.register_type)
151 152 153 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 151 def graphql_type @graphql_type end |
#mixins ⇒ Object
the GraphQL type this struct was generated from, and any registered helper modules to include (see Codegen.register_type)
151 152 153 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 151 def mixins @mixins end |
Instance Method Details
#bare_type ⇒ Object
159 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 159 def = class_name |
#cast(expr, _depth) ⇒ Object
161 162 163 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 161 def cast(expr, _depth) "#{class_name}.from_h(#{expr})" end |
#nested ⇒ Object
165 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 165 def nested = self |