hq-graphql 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hq/graphql/types.rb +2 -0
- data/lib/hq/graphql/version.rb +1 -1
- data/spec/internal/app/models/test_type.rb +1 -0
- data/spec/internal/db/schema.rb +9 -0
- data/spec/lib/graphql/types_spec.rb +46 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13d8a60ff262b288fd5918633fc2db7450620e2b
|
4
|
+
data.tar.gz: 611a0ae3cea59bc3318339dc4d06d9c6370ccbde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac1a7aee6c9eb6df449258dfc71624900fee0e70d6c50f8d57596acf6a9b76ce7a81da4ab26aaa7d6b1bd3bc104402c5deff3630821a193a74a040f45ef2757
|
7
|
+
data.tar.gz: f78cee42cdece49c7211ceec67ac576438eb9bc4e707d9dbb9d6deab6f0835f88ee954cf25f8d8b7b875e29b9126b1aa0adbad8c30b78c702c2ef6d7234e0b8b
|
data/lib/hq/graphql/types.rb
CHANGED
data/lib/hq/graphql/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
class TestType < ::ActiveRecord::Base; end
|
data/spec/internal/db/schema.rb
CHANGED
@@ -18,4 +18,13 @@ ActiveRecord::Schema.define do
|
|
18
18
|
t.timestamps null: false
|
19
19
|
end
|
20
20
|
|
21
|
+
create_table "test_types", force: true, id: :uuid do |t|
|
22
|
+
t.jsonb :data_jsonb
|
23
|
+
t.json :data_json
|
24
|
+
t.integer :count
|
25
|
+
t.decimal :amount
|
26
|
+
t.boolean :is_bool
|
27
|
+
t.string :name
|
28
|
+
end
|
29
|
+
|
21
30
|
end
|
@@ -37,4 +37,50 @@ describe ::HQ::GraphQL::Types do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe ".type_from_column" do
|
41
|
+
context "UUID" do
|
42
|
+
it "matches uuid" do
|
43
|
+
expect(type_from_column("id")).to eq ::HQ::GraphQL::Types::UUID
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context "Object" do
|
48
|
+
it "matches json" do
|
49
|
+
expect(type_from_column("data_json")).to eq ::HQ::GraphQL::Types::Object
|
50
|
+
end
|
51
|
+
|
52
|
+
it "matches jsonb" do
|
53
|
+
expect(type_from_column("data_jsonb")).to eq ::HQ::GraphQL::Types::Object
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context "Int" do
|
58
|
+
it "matches integer" do
|
59
|
+
expect(type_from_column("count")).to eq ::GraphQL::Types::Int
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "Float" do
|
64
|
+
it "matches decimal" do
|
65
|
+
expect(type_from_column("amount")).to eq ::GraphQL::Types::Float
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context "Boolean" do
|
70
|
+
it "matches boolean" do
|
71
|
+
expect(type_from_column("is_bool")).to eq ::GraphQL::Types::Boolean
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
context "String" do
|
76
|
+
it "matches string" do
|
77
|
+
expect(type_from_column("name")).to eq ::GraphQL::Types::String
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def type_from_column(name)
|
82
|
+
described_class.type_from_column(TestType.columns_hash[name])
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
40
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hq-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Jones
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- spec/factories/users.rb
|
117
117
|
- spec/internal/app/models/advisor.rb
|
118
118
|
- spec/internal/app/models/organization.rb
|
119
|
+
- spec/internal/app/models/test_type.rb
|
119
120
|
- spec/internal/app/models/user.rb
|
120
121
|
- spec/internal/config/database.circleci.yml
|
121
122
|
- spec/internal/config/database.yml
|
@@ -158,6 +159,7 @@ test_files:
|
|
158
159
|
- spec/spec_helper.rb
|
159
160
|
- spec/internal/app/models/advisor.rb
|
160
161
|
- spec/internal/app/models/organization.rb
|
162
|
+
- spec/internal/app/models/test_type.rb
|
161
163
|
- spec/internal/app/models/user.rb
|
162
164
|
- spec/internal/config/database.circleci.yml
|
163
165
|
- spec/internal/config/database.yml
|