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(value) ⇒ Object
-
#initialize(of_type:) ⇒ NonNullType
constructor
A new instance of NonNullType.
- #kind ⇒ Object
- #name ⇒ Object
Methods included from BaseType::ModifiesAnotherType
Methods inherited from BaseType
#==, #resolve_type, #to_s, #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(value) ⇒ Object
16 17 18 |
# File 'lib/graphql/non_null_type.rb', line 16 def coerce(value) of_type.coerce(value) end |
#kind ⇒ Object
20 21 22 |
# File 'lib/graphql/non_null_type.rb', line 20 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 |