Sha256: 0bd075f8d4cb60ef7b5124b97054f840420e081cba4844b293e23da1fd7a925d
Contents?: true
Size: 954 Bytes
Versions: 4
Compression:
Stored size: 954 Bytes
Contents
module GraphQL # A collection of {ObjectType}s # # @example a union of types # # PetUnion = GraphQL::UnionType.define do # name "Pet" # description "Animals that live in your house" # possible_types [DogType, CatType, FishType] # end # class UnionType < GraphQL::BaseType include GraphQL::BaseType::HasPossibleTypes attr_accessor :name, :description accepts_definitions :possible_types, :resolve_type def kind GraphQL::TypeKinds::UNION end def include?(child_type_defn) possible_types.include?(child_type_defn) end def possible_types=(new_possible_types) @clean_possible_types = nil @dirty_possible_types = new_possible_types end def possible_types @clean_possible_types ||= begin @dirty_possible_types.map { |type| GraphQL::BaseType.resolve_related_type(type) } rescue @dirty_possible_types end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
graphql-0.16.1 | lib/graphql/union_type.rb |
graphql-0.16.0 | lib/graphql/union_type.rb |
graphql-0.15.3 | lib/graphql/union_type.rb |
graphql-0.15.2 | lib/graphql/union_type.rb |