Module: HQ::GraphQL::Types
- Defined in:
- lib/hq/graphql/types.rb,
lib/hq/graphql/types/uuid.rb,
lib/hq/graphql/types/object.rb
Defined Under Namespace
Classes: Error, Object, UUID
Class Method Summary
collapse
Class Method Details
8
9
10
11
12
13
|
# File 'lib/hq/graphql/types.rb', line 8
def self.[](key)
@types ||= Hash.new do |hash, klass|
hash[klass] = klass_for(klass)
end
@types[key]
end
|
Only being used in testing
33
34
35
|
# File 'lib/hq/graphql/types.rb', line 33
def self.reset!
@types = nil
end
|
.type_from_column(column) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/hq/graphql/types.rb', line 15
def self.type_from_column(column)
case column&.cast_type&.type
when :uuid
::HQ::GraphQL::Types::UUID
when :json, :jsonb
::HQ::GraphQL::Types::Object
when :integer
::GraphQL::Types::Int
when :decimal
::GraphQL::Types::Float
when :boolean
::GraphQL::Types::Boolean
else
::GraphQL::Types::String
end
end
|