hq-graphql 2.1.3 → 2.1.4
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/object.rb +9 -4
- data/lib/hq/graphql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cffa70521d220d85df139e5dab62fec20a97b121578dea7d5fa6cc0991c46501
|
4
|
+
data.tar.gz: b6d9949097849efdd3002dacfc46fe5bf000830d7c86d47bc8f4bfb743321d5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d3933664e856fba5c7111dbea3e6fd6fa653aa5ec170ce5ff6a800d07573d5791290745651513a04ae57e1f2171b38b93d48961350b8bc7a5f9af01fffad507
|
7
|
+
data.tar.gz: 4029d92a6198a414fac136c1b87c850aa94ca92e789065cea70c0e31b0c8e3cdaf3578c1b068bfb367d362e0499580223269f3e467773c57e0621e8a3aa627c1
|
data/lib/hq/graphql/object.rb
CHANGED
@@ -64,9 +64,11 @@ module HQ
|
|
64
64
|
|
65
65
|
def field_from_association(association, auto_nil:, internal_association: false, &block)
|
66
66
|
association_klass = association.klass
|
67
|
-
name = association.name
|
68
|
-
|
69
|
-
|
67
|
+
name = association.name.to_s
|
68
|
+
return if fields[name]
|
69
|
+
|
70
|
+
klass = model_klass
|
71
|
+
type = Types[association_klass]
|
70
72
|
case association.macro
|
71
73
|
when :has_many
|
72
74
|
field name, [type], null: false, klass: model_name do
|
@@ -88,7 +90,10 @@ module HQ
|
|
88
90
|
end
|
89
91
|
|
90
92
|
def field_from_column(column, auto_nil:)
|
91
|
-
|
93
|
+
name = column.name
|
94
|
+
return if fields[name]
|
95
|
+
|
96
|
+
field name, Types.type_from_column(column), null: !auto_nil || column.null
|
92
97
|
end
|
93
98
|
|
94
99
|
def association_required?(association)
|
data/lib/hq/graphql/version.rb
CHANGED