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



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

def association_type
  of_type.association_type
end

#collect_types(types) ⇒ Object



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

def collect_types(types)
  of_type.collect_types types
end

#gql_typeObject



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

def gql_type
  of_type.gql_type
end

#kindObject



345
346
347
# File 'lib/ar_serializer/graphql/types.rb', line 345

def kind
  of_type.kind
end

#nameObject



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

def name
  of_type.name
end

#of_typeObject



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

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

#sampleObject



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

def sample
  nil
end

#ts_typeObject



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

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