Module: GraphQL::Schema::Member::TypeSystemHelpers Private

Included in:
Interface::DefinitionMethods, GraphQL::Schema::Member, Wrapper
Defined in:
lib/graphql/schema/member/type_system_helpers.rb

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

Instance Method Summary collapse

Instance Method Details

#initialize(*args, &block) ⇒ Object

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.



7
8
9
10
11
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 7

def initialize(*args, &block)
  super
  @to_non_null_type ||= nil
  @to_list_type ||= nil
end

#kindGraphQL::TypeKinds::TypeKind

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.



39
40
41
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 39

def kind
  raise GraphQL::RequiredImplementationMissingError, "No `.kind` defined for #{self}"
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 is a list type. A non-nullable list is considered a list.

Returns:

  • (Boolean)

    true if this is a list type. A non-nullable list is considered a list.



30
31
32
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 30

def list?
  false
end

#non_null?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 is a non-nullable type. A nullable list of non-nullables is considered nullable.

Returns:

  • (Boolean)

    true if this is a non-nullable type. A nullable list of non-nullables is considered nullable.



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

def non_null?
  false
end

#to_list_typeSchema::List

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 Make a list-type representation of this type.

Returns:

  • (Schema::List)

    Make a list-type representation of this type



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

def to_list_type
  @to_list_type ||= GraphQL::Schema::List.new(self)
end

#to_non_null_typeSchema::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 Make a non-null-type representation of this type.

Returns:



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

def to_non_null_type
  @to_non_null_type ||= GraphQL::Schema::NonNull.new(self)
end

#to_type_signatureObject

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.



34
35
36
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 34

def to_type_signature
  graphql_name
end