Class: GraphQL::UnionType

Inherits:
BaseType show all
Includes:
BaseType::HasPossibleTypes
Defined in:
lib/graphql/union_type.rb

Overview

A collection of ObjectTypes

Examples:

a union of types


PetUnion = GraphQL::UnionType.define do
  name "Pet"
  description "Animals that live in your house"
  possible_types [DogType, CatType, FishType]
end

Constant Summary

Constants included from BaseType::HasPossibleTypes

BaseType::HasPossibleTypes::DEFAULT_RESOLVE_TYPE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseType::HasPossibleTypes

#include?, #resolve_type, #resolve_type=

Methods inherited from BaseType

#==, #coerce_input, #resolve_type, #to_list_type, #to_non_null_type, #to_s, #unwrap, #valid_input?

Methods included from DefinitionHelpers::DefinedByConfig

included

Methods included from DefinitionHelpers::NonNullWithBang

#!

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



13
14
15
# File 'lib/graphql/union_type.rb', line 13

def description
  @description
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/graphql/union_type.rb', line 13

def name
  @name
end

#possible_typesObject

Returns the value of attribute possible_types.



13
14
15
# File 'lib/graphql/union_type.rb', line 13

def possible_types
  @possible_types
end

Instance Method Details

#kindObject



16
17
18
# File 'lib/graphql/union_type.rb', line 16

def kind
  GraphQL::TypeKinds::UNION
end