graphql-preload 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/graphql-preload.gemspec +1 -1
- data/lib/graphql/preload/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f2b5fb449b2e31a81bf5bf828987a57c355372c
|
4
|
+
data.tar.gz: 170b4686a7424c01e650844b73181496aaf3f3ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0632e5d4d71b0f3087f56e659f2243008c0d4ee9ded0e62cf6d71fd54037e489cd3e20ec8482a9f3defdacf749d591b23082f60d5e42d798d9b84d2357442ee1
|
7
|
+
data.tar.gz: 30027b5d03c0346771062ba8d8a4db3eb8e80e4bfbd0d18e439b49b9f883e9e1ab704075ba273bd45e5dd4a0128e7d0c1da8f7bb5e5e42e17be9d88fc376be04
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# GraphQL::Preload
|
2
2
|
|
3
3
|
Provides a DSL for the [`graphql` gem](https://github.com/rmosolgo/graphql-ruby) that allows ActiveRecord associations to be preloaded in field definitions. Based on a [gist](https://gist.github.com/theorygeek/a1a59a2bf9c59e4b3706ac68d12c8434) by @theorygeek.
|
4
4
|
|
@@ -37,6 +37,12 @@ Call `preload` when defining your field:
|
|
37
37
|
# Post.includes(:comments)
|
38
38
|
preload :comments
|
39
39
|
|
40
|
+
# Post.includes(:comments, :authors)
|
41
|
+
preload [:comments, :authors]
|
42
|
+
|
43
|
+
# Post.includes(:comments, authors: [:posts, :followers])
|
44
|
+
preload [:comments, { authors: [:posts, :followers] }]
|
45
|
+
|
40
46
|
resolve ->(obj, args, ctx) { obj.comments }
|
41
47
|
end
|
42
48
|
end
|
data/graphql-preload.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_runtime_dependency 'activerecord', '>= 3.2', '
|
24
|
+
spec.add_runtime_dependency 'activerecord', '>= 3.2', '< 6'
|
25
25
|
spec.add_runtime_dependency 'graphql', '>= 1.5', '< 2'
|
26
26
|
spec.add_runtime_dependency 'graphql-batch', '~> 0.3'
|
27
27
|
spec.add_runtime_dependency 'promise.rb', '~> 0.7'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-preload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Foster, Etienne Tripier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -17,9 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.2'
|
20
|
-
- - "
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '6'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +27,9 @@ dependencies:
|
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '3.2'
|
30
|
-
- - "
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '6'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: graphql
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|