graphql-extras 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -1
- data/graphql-extras.gemspec +1 -1
- data/lib/graphql/extras/preload.rb +11 -2
- data/lib/graphql/extras/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f3927449d4c9cea85828d5df7ea64954fa489c602ba39e35f938248962d65da
|
4
|
+
data.tar.gz: 3b9564bc9e6d32832e868c983826d007ad99d490c9316ecd8b20ca6eef4ec121
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac5e8a5230c0543d7897ef73ee6634ef44b932adf7af91d6ce1e4f5711955965967ebed75d8b3c23ce97af9e2c24915dc423be3b32aa9af9219f9cd590183acd
|
7
|
+
data.tar.gz: 973a08ada1e4e313299c0f8724d338e2b2b405374e7fb91f7791a3a1d2ead7cf2788564367f747aef563b8be7a2e8e258f2eba7cc18acbbed2484637892626b0
|
data/.github/workflows/build.yml
CHANGED
data/graphql-extras.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
27
|
spec.add_dependency "activesupport", ">= 5.2"
|
28
|
-
spec.add_dependency "graphql", "
|
28
|
+
spec.add_dependency "graphql", [">= 1.12", "< 3"]
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 2.0"
|
31
31
|
spec.add_development_dependency "rake", "~> 13.0"
|
@@ -6,8 +6,17 @@ module GraphQL
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def fetch(records)
|
9
|
-
|
10
|
-
|
9
|
+
if ActiveRecord::VERSION::MAJOR >= 7
|
10
|
+
preloader = ActiveRecord::Associations::Preloader.new(
|
11
|
+
records: records,
|
12
|
+
associations: @preload
|
13
|
+
)
|
14
|
+
preloader.call
|
15
|
+
else
|
16
|
+
preloader = ActiveRecord::Associations::Preloader.new
|
17
|
+
preloader.preload(records, @preload)
|
18
|
+
end
|
19
|
+
|
11
20
|
records
|
12
21
|
end
|
13
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Zane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: graphql
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.12'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '3'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '1.12'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '3'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: bundler
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|