graphql_includable 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58421ff04b72f73e873564c8ac6cfe3d731ed59a
4
- data.tar.gz: edd842cae9ab0006a27caabc27cb68792d52d718
3
+ metadata.gz: 8c4d33679dac4d67ec32b21e75fec07de5880b01
4
+ data.tar.gz: 9740f56824351816c832548ceec61a64181d53a0
5
5
  SHA512:
6
- metadata.gz: 8f6a55a190f097a48cb8aefd9673c6d3d9b996071cd5c1d6a74103dc6592ffc6b26ce47e1f816050c4952b10f93ae108e255c0e6ec9a8234e6493451a408aa27
7
- data.tar.gz: 897f124f919a46f4885e50f9ff2fd54f2c64ca6d7eaced6cd9bad2c6c8223e5ab785fab95a462168e5e699436e7de715201eacd093cf5d0b2d1ff2db68c11fc5
6
+ metadata.gz: 66b0ff3db10a0f536d400082e1645a3ebececc22e44868a89a9edb1f4dddf5f7fb32f1d3b96cd20e57ff4fc06ab8eee600706e0567129e6cafe3aee023e8f873
7
+ data.tar.gz: cadeae8bb2ccfdff4f5de8d03e48294278204c9138d0e92f5c1f998fb1a407bca81fcb43d7551e53a75a8b9f93a1f15825e69b340fc5974fbc8dcb11c554ddf7
@@ -13,7 +13,7 @@ module GraphQLIncludable
13
13
  def includes_from_graphql(ctx)
14
14
  node = GraphQLIncludable::Resolver.find_node_by_return_type(ctx.irep_node, name)
15
15
  generated_includes = GraphQLIncludable::Resolver.includes_for_node(node)
16
- includes(generated_includes)
16
+ preload(generated_includes)
17
17
  rescue => e
18
18
  # As this feature is just for a performance gain, it should never
19
19
  # fail destructively, so catch and log all exceptions, but continue
@@ -21,10 +21,6 @@ module GraphQLIncludable
21
21
  selector = selector.merge(edge_class.includes(*nested_association_names))
22
22
  end
23
23
 
24
- if class_is_polymorphic?(edge_class)
25
- selector = selector.merge(edge_class.joins(root_association_key))
26
- end
27
-
28
24
  selector.find_by(
29
25
  where_hash_for_edge(root_association_key, nested_associations)
30
26
  )
@@ -42,10 +38,6 @@ module GraphQLIncludable
42
38
  end
43
39
  end
44
40
 
45
- def class_is_polymorphic?(klass)
46
- klass.reflections.any? { |_k, r| r.polymorphic? }
47
- end
48
-
49
41
  # Delegate method calls on this Edge instance to the ActiveRecord instance
50
42
  def method_missing(method_name, *args, &block)
51
43
  return super unless edge_record.respond_to?(method_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_includable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Rouse
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-29 00:00:00.000000000 Z
12
+ date: 2018-09-11 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: