Class: GraphQL::NonNullType
- 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
-
#of_type ⇒ Object
readonly
Returns the value of attribute of_type.
Instance Method Summary collapse
- #coerce_input(value) ⇒ Object
- #coerce_result(value) ⇒ Object
-
#initialize(of_type:) ⇒ NonNullType
constructor
A new instance of NonNullType.
- #kind ⇒ Object
- #name ⇒ Object
- #to_s ⇒ Object
Methods included from BaseType::ModifiesAnotherType
Methods inherited from BaseType
#==, #coerce_input!, #resolve_type, #to_list_type, #to_non_null_type, #unwrap
Methods included from DefinitionHelpers::DefinedByConfig
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_type ⇒ Object (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_input(value) ⇒ Object
16 17 18 |
# File 'lib/graphql/non_null_type.rb', line 16 def coerce_input(value) of_type.coerce_input(value) end |
#coerce_result(value) ⇒ Object
20 21 22 |
# File 'lib/graphql/non_null_type.rb', line 20 def coerce_result(value) of_type.coerce_result(value) end |
#kind ⇒ Object
24 25 26 |
# File 'lib/graphql/non_null_type.rb', line 24 def kind GraphQL::TypeKinds::NON_NULL end |
#name ⇒ Object
12 13 14 |
# File 'lib/graphql/non_null_type.rb', line 12 def name "Non-Null" end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/graphql/non_null_type.rb', line 28 def to_s "#{of_type.to_s}!" end |