Class: GraphQL::Schema::Wrapper

Inherits:
Object
  • Object
show all
Includes:
Member::CachedGraphQLDefinition, Member::TypeSystemHelpers
Defined in:
lib/graphql/schema/wrapper.rb

Direct Known Subclasses

List, NonNull

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Member::TypeSystemHelpers

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

Methods included from Member::CachedGraphQLDefinition

#graphql_definition, #initialize_copy, #type_class

Constructor Details

#initialize(of_type) ⇒ Wrapper

Returns a new instance of Wrapper.


12
13
14
# File 'lib/graphql/schema/wrapper.rb', line 12

def initialize(of_type)
  @of_type = of_type
end

Instance Attribute Details

#of_typeClass, Module (readonly)

Returns The inner type of this wrapping type, the type of which one or more objects may be present.

Returns:

  • (Class, Module)

    The inner type of this wrapping type, the type of which one or more objects may be present.


10
11
12
# File 'lib/graphql/schema/wrapper.rb', line 10

def of_type
  @of_type
end

Instance Method Details

#==(other) ⇒ Object


24
25
26
# File 'lib/graphql/schema/wrapper.rb', line 24

def ==(other)
  self.class == other.class && of_type == other.of_type
end

#to_graphqlObject


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

def to_graphql
  raise GraphQL::RequiredImplementationMissingError
end

#unwrapObject


20
21
22
# File 'lib/graphql/schema/wrapper.rb', line 20

def unwrap
  @of_type.unwrap
end