Class: GraphQL::Client::Schema::NonNullType
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
BaseType
|
|
Inherits: | Object |
Defined in: | lib/graphql/client/schema/non_null_type.rb |
Class Method Summary
-
.new(of_klass) ⇒ NonNullType
constructor
Internal: Construct non-nullable wrapper from other
BaseType
.
Instance Attribute Summary
-
#of_klass
readonly
Internal: Get wrapped klass.
BaseType
- Included
#schema_module | Internal: Get owner schema Module container. |
#type | Public: Get associated |
Instance Method Summary
-
#cast(value, errors)
Internal: Cast JSON value to wrapped value.
-
#to_non_null_type
Internal: Get non-nullable wrapper of this type class.
BaseType
- Included
#cast | Internal: Cast JSON value to wrapped value. |
#to_list_type | Internal: Get list wrapper of this type class. |
#to_non_null_type | Internal: Get non-nullable wrapper of this type class. |
Constructor Details
.new(of_klass) ⇒ NonNullType
[ GitHub ]
Instance Attribute Details
#of_klass (readonly)
Internal: Get wrapped klass.
Returns BaseType instance.
# File 'lib/graphql/client/schema/non_null_type.rb', line 26
attr_reader :of_klass
Instance Method Details
#cast(value, errors)
Internal: Cast JSON value to wrapped value.
value - JSON value errors - ::GraphQL::Client::Errors
instance
Returns BaseType instance.
# File 'lib/graphql/client/schema/non_null_type.rb', line 34
def cast(value, errors) case value when NilClass raise InvariantError, "expected value to be non-nullable, but was nil" else of_klass.cast(value, errors) end end
#to_non_null_type
Internal: Get non-nullable wrapper of this type class.
Returns NonNullType instance.
# File 'lib/graphql/client/schema/non_null_type.rb', line 46
def to_non_null_type self end