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.
270 271 272 273 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 270 def initialize(class_name, members) @class_name = class_name @members = members end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
graphql type name => ObjectNode
268 269 270 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 268 def class_name @class_name end |
#members ⇒ Object (readonly)
graphql type name => ObjectNode
268 269 270 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 268 def members @members end |
Instance Method Details
#bare_type ⇒ Object
275 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 275 def = "#{class_name}::Type" |
#cast(expr, _depth) ⇒ Object
277 278 279 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 277 def cast(expr, _depth) "#{class_name}.from_h(#{expr})" end |
#nested ⇒ Object
281 |
# File 'lib/graph_weaver/codegen/nodes.rb', line 281 def nested = self |