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

#initializeObject

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(...)
  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.



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

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.



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

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.



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

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



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

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:



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

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.



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

def to_type_signature
  graphql_name
end