Class: GraphQL::Schema::NonNull Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Wraps a Member when it is required.

See Also:

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Member::TypeSystemHelpers

#to_list_type, #to_non_null_type

Methods included from Member::CachedGraphQLDefinition

#graphql_definition, #initialize_copy

Constructor Details

#initialize(of_type) ⇒ NonNull

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of NonNull



11
12
13
# File 'lib/graphql/schema/non_null.rb', line 11

def initialize(of_type)
  @of_type = of_type
end

Instance Attribute Details

#of_typeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def of_type
  @of_type
end

Instance Method Details

#kindObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/graphql/schema/non_null.rb', line 29

def kind
  GraphQL::TypeKinds::NON_NULL
end

#list?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns True if this type wraps a list type

Returns:

  • (Boolean)

    True if this type wraps a list type



25
26
27
# File 'lib/graphql/schema/non_null.rb', line 25

def list?
  @of_type.list?
end

#non_null?true

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (true)


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

def non_null?
  true
end

#to_graphqlObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def to_graphql
  @of_type.graphql_definition.to_non_null_type
end

#unwrapObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/graphql/schema/non_null.rb', line 33

def unwrap
  @of_type.unwrap
end