Class: GraphWeaver::Codegen::UnionNode
- Defined in:
- lib/graph_weaver/codegen/nodes.rb
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
graphql type name => ObjectNode.
-
#members ⇒ Object
readonly
graphql type name => ObjectNode.
Instance Method Summary collapse
- #bare_type ⇒ Object
- #cast(expr, _depth) ⇒ Object
-
#initialize(class_name, members) ⇒ UnionNode
constructor
A new instance of UnionNode.
- #nested ⇒ Object
Methods inherited from Node
#coerce?, #hash_coerce_identity?, #identity?, #non_null?, #prop_type, #serialize_identity?
Constructor Details
#initialize(class_name, members) ⇒ UnionNode
Returns a new instance of UnionNode.
266 267 268 269 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 266 def initialize(class_name, members) @class_name = class_name @members = members end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
graphql type name => ObjectNode
264 265 266 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 264 def class_name @class_name end |
#members ⇒ Object (readonly)
graphql type name => ObjectNode
264 265 266 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 264 def members @members end |
Instance Method Details
#bare_type ⇒ Object
271 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 271 def = "#{class_name}::Type" |
#cast(expr, _depth) ⇒ Object
273 274 275 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 273 def cast(expr, _depth) "#{class_name}.from_h(#{expr})" end |
#nested ⇒ Object
277 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 277 def nested = self |