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: 81c7c496fd558d2f36960ae703d3b785a59a843bfde46fbc8cd286a82c47a7e1
4
- data.tar.gz: eeacd401c91ea7cc795d9d02d362a16d8eb07ed8f4a86e9096a0a23383fda773
3
+ metadata.gz: fbec3146d7a2dce71d912a2adc93103c9818fea88cb51309bb839771457e853d
4
+ data.tar.gz: a268083411b6fa27e410e94dc001a134471e9622d3cec46b9444db22beaab61e
5
5
  SHA512:
6
- metadata.gz: a0cb7ca2b4d67e15f175578bbe21ed20a57f1548eb7b2adc379606069950ac281b0293a77587696c84531a512f29ca7e44106186451c5d659935290c933ba044
7
- data.tar.gz: 100dbcdc2189b2d55a17386ddcff89fc2410337a080335b4fcf2a377555b0211e0418ac97ff9f04a83151a2a4a777003b1b6b1fe5ea5b46b26c1672ed9db0f21
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?
@@ -40,7 +40,8 @@ module GraphQL
40
40
  @loader.context = context if @loader.respond_to?(:context=)
41
41
  end
42
42
 
43
- def resolve(*)
43
+ def resolve(*args)
44
+ loader.args = *args
44
45
  loader.load(object)
45
46
  end
46
47
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module AssociationBatchResolver
5
- VERSION = '0.1.11'
5
+ VERSION = '0.1.12'
6
6
  end
7
7
  end
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.11
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-22 00:00:00.000000000 Z
11
+ date: 2019-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord