Class: ArSerializer::GraphQL::OrTypeClass
Instance Attribute Summary
Attributes inherited from TypeClass
#except, #only, #type
Instance Method Summary
collapse
Methods inherited from TypeClass
#association_type, #description, #fields, from, #initialize, #of_type, #validate!
Instance Method Details
#collect_types(types) ⇒ Object
391
392
393
394
|
# File 'lib/ar_serializer/graphql/types.rb', line 391
def collect_types(types)
types[:other] = true
of_types.map { |t| t.collect_types types }
end
|
#gql_type ⇒ Object
396
397
398
|
# File 'lib/ar_serializer/graphql/types.rb', line 396
def gql_type
kind
end
|
#kind ⇒ Object
379
380
381
|
# File 'lib/ar_serializer/graphql/types.rb', line 379
def kind
'OBJECT'
end
|
#name ⇒ Object
383
384
385
|
# File 'lib/ar_serializer/graphql/types.rb', line 383
def name
:other
end
|
#of_types ⇒ Object
387
388
389
|
# File 'lib/ar_serializer/graphql/types.rb', line 387
def of_types
type.map { |t| TypeClass.from t, only, except }
end
|
#sample ⇒ Object
400
401
402
|
# File 'lib/ar_serializer/graphql/types.rb', line 400
def sample
of_types.first.sample
end
|
#ts_type ⇒ Object
404
405
406
|
# File 'lib/ar_serializer/graphql/types.rb', line 404
def ts_type
'(' + of_types.map(&:ts_type).join(' | ') + ')'
end
|