graphql-association_batch_resolver 0.1.11 → 0.1.12
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbec3146d7a2dce71d912a2adc93103c9818fea88cb51309bb839771457e853d
|
4
|
+
data.tar.gz: a268083411b6fa27e410e94dc001a134471e9622d3cec46b9444db22beaab61e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb1c456ed27429db12a5e8926223695be049182e93f32cc450d302eecd18f3c53d98d24151e1406e6cb8587866b0d66b2a6e4f57d35e35692d80cf742edccdb0
|
7
|
+
data.tar.gz: 1d439a65e05a06b7dae8ba93d800997671262af091a44d212e0bb392c94716ecdc19d9392c1031422edd43e30cc38e7a50c275e71eb1529b1b11b6764aab0e49
|
@@ -7,7 +7,7 @@ module GraphQL
|
|
7
7
|
class AssociationLoader < GraphQL::Batch::Loader
|
8
8
|
attr_reader :model, :model_primary_key, :association_name, :is_collection, :association_model,
|
9
9
|
:association_primary_key, :options
|
10
|
-
attr_accessor :scope, :context
|
10
|
+
attr_accessor :scope, :context, :args
|
11
11
|
|
12
12
|
def self.validate(model, association_name, options = {})
|
13
13
|
new(model, association_name, options)
|
@@ -51,7 +51,7 @@ module GraphQL
|
|
51
51
|
|
52
52
|
def preload_association(records)
|
53
53
|
association_records = associations_for(records)
|
54
|
-
association_records = options[:scope].call(association_records, context) if options[:scope].respond_to?(:call)
|
54
|
+
association_records = options[:scope].call(association_records, context, *args) if options[:scope].respond_to?(:call)
|
55
55
|
find_by_sql = association_records.to_sql
|
56
56
|
|
57
57
|
self.scope = if find_by_sql.present?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-association_batch_resolver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Derenge
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|