Class: GraphQL::UnionType
- Includes:
- BaseType::HasPossibleTypes
- Defined in:
- lib/graphql/union_type.rb
Overview
A collection of ObjectTypes
Constant Summary
Constants included from BaseType::HasPossibleTypes
BaseType::HasPossibleTypes::DEFAULT_RESOLVE_TYPE
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #include?(child_type_defn) ⇒ Boolean
- #kind ⇒ Object
- #possible_types ⇒ Object
- #possible_types=(new_possible_types) ⇒ Object
Methods included from BaseType::HasPossibleTypes
Methods inherited from BaseType
#==, #coerce_input, resolve_related_type, #resolve_type, #to_list_type, #to_non_null_type, #to_s, #unwrap, #valid_input?, #validate_input
Methods included from Define::InstanceDefinable
Methods included from Define::NonNullWithBang
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/graphql/union_type.rb', line 14 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/graphql/union_type.rb', line 14 def name @name end |
Instance Method Details
#include?(child_type_defn) ⇒ Boolean
21 22 23 |
# File 'lib/graphql/union_type.rb', line 21 def include?(child_type_defn) possible_types.include?(child_type_defn) end |
#kind ⇒ Object
17 18 19 |
# File 'lib/graphql/union_type.rb', line 17 def kind GraphQL::TypeKinds::UNION end |
#possible_types ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/graphql/union_type.rb', line 30 def possible_types @clean_possible_types ||= begin @dirty_possible_types.map { |type| GraphQL::BaseType.(type) } rescue @dirty_possible_types end end |
#possible_types=(new_possible_types) ⇒ Object
25 26 27 28 |
# File 'lib/graphql/union_type.rb', line 25 def possible_types=(new_possible_types) @clean_possible_types = nil @dirty_possible_types = new_possible_types end |