Module: GraphQL::Client::Schema::BaseType
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/graphql/client/schema/base_type.rb |
Instance Attribute Summary
-
#schema_module
rw
Internal: Get owner schema Module container.
-
#type
readonly
Public: Get associated
GraphQL::BaseType
with for this class.
Instance Method Summary
-
#cast(value, errors)
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.
Instance Attribute Details
#schema_module (rw)
Internal: Get owner schema Module container.
# File 'lib/graphql/client/schema/base_type.rb', line 11
attr_accessor :schema_module
#type (readonly)
Public: Get associated GraphQL::BaseType
with for this class.
# File 'lib/graphql/client/schema/base_type.rb', line 8
attr_reader :type
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/base_type.rb', line 19
def cast(value, errors) raise NotImplementedError, "subclasses must implement #cast(value, errors)" end
#to_list_type
Internal: Get list wrapper of this type class.
Returns ListType instance.
#to_non_null_type
Internal: Get non-nullable wrapper of this type class.
Returns NonNullType instance.
# File 'lib/graphql/client/schema/base_type.rb', line 26
def to_non_null_type @null_type ||= NonNullType.new(self) end