Class: ArSerializer::GraphQL::OptionalTypeClass

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

Instance Attribute Summary

Attributes inherited from TypeClass

#except, #only, #type

Instance Method Summary collapse

Methods inherited from TypeClass

#description, #fields, from, #initialize, #validate!

Constructor Details

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

Instance Method Details

#association_typeObject



365
366
367
# File 'lib/ar_serializer/graphql/types.rb', line 365

def association_type
  of_type.association_type
end

#collect_types(types) ⇒ Object



369
370
371
# File 'lib/ar_serializer/graphql/types.rb', line 369

def collect_types(types)
  of_type.collect_types types
end

#gql_typeObject



373
374
375
# File 'lib/ar_serializer/graphql/types.rb', line 373

def gql_type
  of_type.gql_type
end

#kindObject



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

def kind
  of_type.kind
end

#nameObject



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

def name
  of_type.name
end

#of_typeObject



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

def of_type
  TypeClass.from type.first, only, except
end

#sampleObject



377
378
379
# File 'lib/ar_serializer/graphql/types.rb', line 377

def sample
  nil
end

#ts_typeObject



381
382
383
# File 'lib/ar_serializer/graphql/types.rb', line 381

def ts_type
  "(#{of_type.ts_type} | null)"
end