123456789_123456789_123456789_123456789_123456789_

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

Instance Attribute Details

#schema_module (rw)

Internal: Get owner schema Module container.

[ GitHub ]

  
# 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.

[ GitHub ]

  
# 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.

[ GitHub ]

  
# 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.

[ GitHub ]

  
# File 'lib/graphql/client/schema/base_type.rb', line 33

def to_list_type
  @list_type ||= ListType.new(self)
end

#to_non_null_type

Internal: Get non-nullable wrapper of this type class.

Returns NonNullType instance.

[ GitHub ]

  
# File 'lib/graphql/client/schema/base_type.rb', line 26

def to_non_null_type
  @null_type ||= NonNullType.new(self)
end