Class: GraphQL::Client::Schema::IncludeDirective

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, BaseType
Inherits: Object
Defined in: lib/graphql/client/schema/include_directive.rb

Class Method Summary

Instance Attribute Summary

BaseType - Included


Internal: Get owner schema Module container.


Public: Get associated GraphQL::BaseType with for this class.

Instance Method Summary

BaseType - Included


Internal: Cast JSON value to wrapped value.


Internal: Get list wrapper of this type class.


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

Constructor Details

.new(of_klass) ⇒ IncludeDirective

Internal: Construct list wrapper from other BaseType.

of_klass - BaseType instance

[ GitHub ]

# File 'lib/graphql/client/schema/include_directive.rb', line 14

def initialize(of_klass)
  unless of_klass.is_a?(BaseType)
    raise TypeError, "expected #{of_klass.inspect} to be a #{BaseType}"

  @of_klass = of_klass

Instance Attribute Details

#of_klass (readonly)

Internal: Get wrapped klass.

Returns BaseType instance.

[ GitHub ]

# File 'lib/graphql/client/schema/include_directive.rb', line 25

attr_reader :of_klass

Instance Method Details

#cast(value, errors)

Internal: Cast JSON value to wrapped value.

values - JSON value errors - ::GraphQL::Client::Errors instance

Returns List instance or nil.

[ GitHub ]

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

def cast(value, errors)
  case value
  when NilClass
    of_klass.cast(value, errors)