Class: GraphQL::Schema::List

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

Overview

Represents a list type in the schema. Wraps a Member as a list type.

See Also:

  • {Schema{Schema::Member{Schema::Member::TypeSystemHelpers{Schema::Member::TypeSystemHelpers#to_list_type}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Member::TypeSystemHelpers

#list?, #non_null?, #to_list_type, #to_non_null_type

Methods included from Member::CachedGraphQLDefinition

#graphql_definition, #initialize_copy

Constructor Details

#initialize(of_type) ⇒ List

Returns a new instance of List



15
16
17
# File 'lib/graphql/schema/list.rb', line 15

def initialize(of_type)
  @of_type = of_type
end

Instance Attribute Details

#of_typeClass, Module (readonly)

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

Returns:

  • (Class, Module)

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



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

def of_type
  @of_type
end

Instance Method Details

#kindObject



23
24
25
# File 'lib/graphql/schema/list.rb', line 23

def kind
  GraphQL::TypeKinds::LIST
end

#to_graphqlObject



19
20
21
# File 'lib/graphql/schema/list.rb', line 19

def to_graphql
  @of_type.graphql_definition.to_list_type
end

#unwrapObject



27
28
29
# File 'lib/graphql/schema/list.rb', line 27

def unwrap
  @of_type.unwrap
end