hq-graphql 2.1.9 → 2.1.10
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/active_record_extensions.rb +4 -0
- data/lib/hq/graphql/input_object.rb +8 -1
- data/lib/hq/graphql/object.rb +6 -2
- data/lib/hq/graphql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dd3d2f47411b616e76f20e118b4a959af58a13223b5d8e758bb35919c5b2b02
|
4
|
+
data.tar.gz: 781c03507b71570f5e9c6b9dc34117f34649097d1e4026701fd740c78209acad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5be4f443b74567f67e082cec1ae52d83f3adb0b2ae7964afb2f49e74467ed0185c04f34f363f3a0bb153e97bf90c7d8eff2e831d9d137cb1ca7c669b9af2ac8
|
7
|
+
data.tar.gz: aecd6fcaf3f269d0bf2d7504cdebf4e022fd5e4c670d9ad5153f1658d127ba12ca0661711d7cfd1863615d0b94b7ab2098dd5d8e22a8fbb7271a41f5f5a89da5
|
@@ -67,6 +67,7 @@ module HQ
|
|
67
67
|
is_enum = is_enum?(association)
|
68
68
|
input_or_type = is_enum ? ::HQ::GraphQL::Types[association.klass] : ::HQ::GraphQL::Inputs[association.klass]
|
69
69
|
name = association.name
|
70
|
+
return if argument_exists?(name)
|
70
71
|
|
71
72
|
case association.macro
|
72
73
|
when :has_many
|
@@ -87,7 +88,13 @@ module HQ
|
|
87
88
|
end
|
88
89
|
|
89
90
|
def argument_from_column(column)
|
90
|
-
|
91
|
+
name = column.name
|
92
|
+
return if argument_exists?(name)
|
93
|
+
argument name, ::HQ::GraphQL::Types.type_from_column(column), required: false
|
94
|
+
end
|
95
|
+
|
96
|
+
def argument_exists?(name)
|
97
|
+
!!arguments[camelize(name)]
|
91
98
|
end
|
92
99
|
end
|
93
100
|
end
|
data/lib/hq/graphql/object.rb
CHANGED
@@ -65,7 +65,7 @@ module HQ
|
|
65
65
|
def field_from_association(association, auto_nil:, internal_association: false, &block)
|
66
66
|
association_klass = association.klass
|
67
67
|
name = association.name.to_s
|
68
|
-
return if
|
68
|
+
return if field_exists?(name)
|
69
69
|
|
70
70
|
klass = model_klass
|
71
71
|
type = Types[association_klass]
|
@@ -95,11 +95,15 @@ module HQ
|
|
95
95
|
|
96
96
|
def field_from_column(column, auto_nil:)
|
97
97
|
name = column.name
|
98
|
-
return if
|
98
|
+
return if field_exists?(name)
|
99
99
|
|
100
100
|
field name, Types.type_from_column(column), null: !auto_nil || column.null
|
101
101
|
end
|
102
102
|
|
103
|
+
def field_exists?(name)
|
104
|
+
!!fields[camelize(name)]
|
105
|
+
end
|
106
|
+
|
103
107
|
def association_required?(association)
|
104
108
|
!association.options[:optional] || has_presence_validation?(association)
|
105
109
|
end
|
data/lib/hq/graphql/version.rb
CHANGED
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: 2.1.
|
4
|
+
version: 2.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Jones
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|