Class: GraphWeaver::Codegen::UnionRefNode
- Defined in:
- lib/graph_weaver/codegen/nodes.rb
Overview
A reference to a union hoisted into the shared unions module (a named
shared fragment spread as a whole union field): the query references
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
Instance Method Summary collapse
- #bare_type ⇒ Object
- #cast(expr, _depth) ⇒ Object
-
#initialize(class_name) ⇒ UnionRefNode
constructor
A new instance of UnionRefNode.
Methods inherited from Node
#coerce?, #hash_coerce_identity?, #identity?, #nested, #non_null?, #prop_type, #serialize_identity?
Constructor Details
#initialize(class_name) ⇒ UnionRefNode
Returns a new instance of UnionRefNode.
293 294 295 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 293 def initialize(class_name) @class_name = class_name end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
291 292 293 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 291 def class_name @class_name end |
Instance Method Details
#bare_type ⇒ Object
297 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 297 def = "#{class_name}::Type" |
#cast(expr, _depth) ⇒ Object
299 300 301 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 299 def cast(expr, _depth) "#{class_name}.from_h(#{expr})" end |