Class: GraphQL::NonNullType

Inherits:
BaseType show all
Includes:
BaseType::ModifiesAnotherType
Defined in:
lib/graphql/non_null_type.rb

Overview

A non-null type wraps another type.

Get the underlying type with BaseType::ModifiesAnotherType#unwrap

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseType::ModifiesAnotherType

#unwrap

Methods inherited from BaseType

#==, #resolve_type, #to_s, #unwrap

Methods included from DefinitionHelpers::DefinedByConfig

included

Methods included from DefinitionHelpers::NonNullWithBang

#!

Constructor Details

#initialize(of_type:) ⇒ NonNullType

Returns a new instance of NonNullType.



8
9
10
# File 'lib/graphql/non_null_type.rb', line 8

def initialize(of_type:)
  @of_type = of_type
end

Instance Attribute Details

#of_typeObject (readonly)

Returns the value of attribute of_type.



7
8
9
# File 'lib/graphql/non_null_type.rb', line 7

def of_type
  @of_type
end

Instance Method Details

#coerce(value) ⇒ Object



16
17
18
# File 'lib/graphql/non_null_type.rb', line 16

def coerce(value)
  of_type.coerce(value)
end

#kindObject



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

def kind
  GraphQL::TypeKinds::NON_NULL
end

#nameObject



12
13
14
# File 'lib/graphql/non_null_type.rb', line 12

def name
  "Non-Null"
end