Class: GraphQL::Schema::NonNull

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/graphql/schema/non_null.rb

Overview

Represents a non null type in the schema. 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

Attributes inherited from Wrapper

#of_type

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #initialize, #unwrap

Methods included from Member::TypeSystemHelpers

#to_list_type, #to_non_null_type

Methods included from Member::CachedGraphQLDefinition

#graphql_definition, #initialize_copy

Constructor Details

This class inherits a constructor from GraphQL::Schema::Wrapper

Instance Method Details

#inspectObject



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

def inspect
  "#<#{self.class.name} @of_type=#{@of_type.inspect}>"
end

#kindGraphQL::TypeKinds::NON_NULL

Returns:

  • (GraphQL::TypeKinds::NON_NULL)


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

def kind
  GraphQL::TypeKinds::NON_NULL
end

#list?Boolean

Returns True if this type wraps a list type

Returns:

  • (Boolean)

    True if this type wraps a list type



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

def list?
  @of_type.list?
end

#non_null?true

Returns:

  • (true)


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

def non_null?
  true
end

#to_graphqlObject



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

def to_graphql
  @of_type.graphql_definition.to_non_null_type
end

#to_type_signatureObject



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

def to_type_signature
  "#{@of_type.to_type_signature}!"
end