Class: GraphQL::GraphQLUnionType
- Inherits:
-
Configuration::Configurable
- Object
- Configuration::Configurable
- GraphQL::GraphQLUnionType
- Includes:
- GraphQLAbstractType, GraphQLCompositeType, GraphQLNamedType, GraphQLNullableType, GraphQLOutputType, GraphQLType
- Defined in:
- lib/graphql/type/union_type.rb
Instance Method Summary collapse
- #possible_type?(type) ⇒ Boolean
- #possible_types ⇒ Object
- #resolve_type(type) ⇒ Object
- #to_s ⇒ Object
Methods included from GraphQLNullableType
Methods included from GraphQLAbstractType
Methods included from GraphQLType
Methods inherited from Configuration::Configurable
configuration, configure_with, #initialize, #method_missing, new
Constructor Details
This class inherits a constructor from GraphQL::Configuration::Configurable
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GraphQL::Configuration::Configurable
Instance Method Details
#possible_type?(type) ⇒ Boolean
25 26 27 |
# File 'lib/graphql/type/union_type.rb', line 25 def possible_type?(type) @configuration.types.include?(type) end |
#possible_types ⇒ Object
21 22 23 |
# File 'lib/graphql/type/union_type.rb', line 21 def possible_types @configuration.types end |
#resolve_type(type) ⇒ Object
29 30 31 |
# File 'lib/graphql/type/union_type.rb', line 29 def resolve_type(type) @configuration.resolve_type.nil? ? type_of(type) : @configuration.resolve_type.call(type) end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/graphql/type/union_type.rb', line 33 def to_s name end |