Class: GraphQL::NonNullType
- Inherits:
-
ObjectType
- Object
- ObjectType
- GraphQL::NonNullType
- Defined in:
- lib/graphql/non_null_type.rb
Overview
A non-null type wraps another type.
See TypeKind#unwrap for accessing the modified type
Instance Attribute Summary collapse
-
#of_type ⇒ Object
readonly
Returns the value of attribute of_type.
Attributes inherited from ObjectType
#description, #fields, #interfaces
Instance Method Summary collapse
- #coerce(value) ⇒ Object
-
#initialize(of_type:) ⇒ NonNullType
constructor
A new instance of NonNullType.
- #kind ⇒ Object
- #name ⇒ Object
Methods inherited from ObjectType
Methods included from DefinitionHelpers::DefinedByConfig
Methods included from DefinitionHelpers::NonNullWithBang
Constructor Details
#initialize(of_type:) ⇒ NonNullType
Returns a new instance of NonNullType.
6 7 8 |
# File 'lib/graphql/non_null_type.rb', line 6 def initialize(of_type:) @of_type = of_type end |
Instance Attribute Details
#of_type ⇒ Object (readonly)
Returns the value of attribute of_type.
5 6 7 |
# File 'lib/graphql/non_null_type.rb', line 5 def of_type @of_type end |
Instance Method Details
#coerce(value) ⇒ Object
14 15 16 |
# File 'lib/graphql/non_null_type.rb', line 14 def coerce(value) of_type.coerce(value) end |
#kind ⇒ Object
18 19 20 |
# File 'lib/graphql/non_null_type.rb', line 18 def kind GraphQL::TypeKinds::NON_NULL end |
#name ⇒ Object
10 11 12 |
# File 'lib/graphql/non_null_type.rb', line 10 def name "Non-Null" end |