Class: ArSerializer::GraphQL::OrTypeClass

Inherits:
TypeClass
  • Object
show all
Defined in:
lib/ar_serializer/graphql/types.rb

Instance Attribute Summary

Attributes inherited from TypeClass

#type

Instance Method Summary collapse

Methods inherited from TypeClass

#association_type, #description, #fields, from, #initialize, #of_type

Constructor Details

This class inherits a constructor from ArSerializer::GraphQL::TypeClass

Instance Method Details

#collect_types(types) ⇒ Object



354
355
356
357
# File 'lib/ar_serializer/graphql/types.rb', line 354

def collect_types(types)
  types[:other] = true
  type.map { |t| t.collect_types types }
end

#gql_typeObject



359
# File 'lib/ar_serializer/graphql/types.rb', line 359

def gql_type = kind

#kindObject



348
# File 'lib/ar_serializer/graphql/types.rb', line 348

def kind = 'OBJECT'

#nameObject



350
# File 'lib/ar_serializer/graphql/types.rb', line 350

def name = :other

#of_typesObject



352
# File 'lib/ar_serializer/graphql/types.rb', line 352

def of_types = type

#ts_typeObject



361
# File 'lib/ar_serializer/graphql/types.rb', line 361

def ts_type = "(#{type.map(&:ts_type).join(' | ')})"