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



367
368
369
# File 'lib/ar_serializer/graphql/types.rb', line 367

def association_type
  of_type.association_type
end

#collect_types(types) ⇒ Object



371
372
373
# File 'lib/ar_serializer/graphql/types.rb', line 371

def collect_types(types)
  of_type.collect_types types
end

#gql_typeObject



375
376
377
# File 'lib/ar_serializer/graphql/types.rb', line 375

def gql_type
  of_type.gql_type
end

#kindObject



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

def kind
  of_type.kind
end

#nameObject



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

def name
  of_type.name
end

#of_typeObject



363
364
365
# File 'lib/ar_serializer/graphql/types.rb', line 363

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

#sampleObject



379
380
381
# File 'lib/ar_serializer/graphql/types.rb', line 379

def sample
  nil
end

#ts_typeObject



383
384
385
# File 'lib/ar_serializer/graphql/types.rb', line 383

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