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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 412060a07e4a7640f360fd987b130eff199b5abb
4
- data.tar.gz: 7ee60048595cd21c4f3a3b75e7eb60acba2c2633
3
+ metadata.gz: 0f2b5fb449b2e31a81bf5bf828987a57c355372c
4
+ data.tar.gz: 170b4686a7424c01e650844b73181496aaf3f3ce
5
5
  SHA512:
6
- metadata.gz: c4d07b403576d3ac174cf54d864ffc28e0549735625f43addc80ce4f6e7a4b32d98078d29c34acd3ddbbb45c8b46123ba6594680782a7786c8a3ab33b47de28d
7
- data.tar.gz: cabf3cb48477c1f66ece36283817fd6af855e1eeb8305cdb685471f60ddd15be25627e43e91f0794da163a4a3146c48ed099287a33dc98f6424e3078ca80d22c
6
+ metadata.gz: 0632e5d4d71b0f3087f56e659f2243008c0d4ee9ded0e62cf6d71fd54037e489cd3e20ec8482a9f3defdacf749d591b23082f60d5e42d798d9b84d2357442ee1
7
+ data.tar.gz: 30027b5d03c0346771062ba8d8a4db3eb8e80e4bfbd0d18e439b49b9f883e9e1ab704075ba273bd45e5dd4a0128e7d0c1da8f7bb5e5e42e17be9d88fc376be04
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Graphql::Preload
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
@@ -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', '<= 5'
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'
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Preload
3
- VERSION = '1.0.1'.freeze
3
+ VERSION = '1.0.2'.freeze
4
4
  end
5
5
  end
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.1
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-13 00:00:00.000000000 Z
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: '5'
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: '5'
32
+ version: '6'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: graphql
35
35
  requirement: !ruby/object:Gem::Requirement