graphql_includable 0.5.0.beta.1 → 0.5.0.beta.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ff94b42c9f62e3adc1f3d5b29c94665d589f342
|
4
|
+
data.tar.gz: 430173439d5f877b268a9fc3e26a8e1dd6cb5ff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82b3fc3aab541b0ffdb88fb7b4a6162ee9e9767ec91dac7d3f539965af8cd9d073d69507283aa7fa60f1b16757f03ac2010ffdbae97e375fa4a323c02233eb2e
|
7
|
+
data.tar.gz: 5e1996a5dd70f475ef83d4f531e706869379bf4d47a1255dbb7270dd26108a4bec22a7e1175070189e84c879699c0d4d0910757341b279acfdcc0bfb40201fbb
|
@@ -30,6 +30,12 @@ module GraphQLIncludable
|
|
30
30
|
@included_children[key]
|
31
31
|
end
|
32
32
|
|
33
|
+
def dig(*args)
|
34
|
+
args = args[0] if args.length == 1 && args[0].is_a?(Array)
|
35
|
+
return @included_children if args.length == 0
|
36
|
+
@included_children.dig(*args)
|
37
|
+
end
|
38
|
+
|
33
39
|
def empty?
|
34
40
|
@included_children.empty?
|
35
41
|
end
|
@@ -18,11 +18,7 @@ module GraphQLIncludable
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def path_leaf_includes
|
21
|
-
|
22
|
-
included_path.each do |key|
|
23
|
-
leaf_includes = leaf_includes[key]
|
24
|
-
end
|
25
|
-
leaf_includes
|
21
|
+
@includes.dig(included_path)
|
26
22
|
end
|
27
23
|
|
28
24
|
def path(*symbols, &block)
|
@@ -26,12 +26,13 @@ module GraphQLIncludable
|
|
26
26
|
return includes_for_connection(node, includes) if node.definition.connection?
|
27
27
|
|
28
28
|
builder = build_includes(node)
|
29
|
-
return unless builder
|
29
|
+
return unless builder.present?
|
30
|
+
includes.merge_includes(builder.includes) unless builder.includes.empty?
|
30
31
|
|
31
|
-
|
32
|
+
return unless builder.includes?
|
32
33
|
|
33
34
|
# Determine which [nested] child Includes manager to send to the children
|
34
|
-
child_includes = builder.
|
35
|
+
child_includes = includes.dig(builder.included_path)
|
35
36
|
|
36
37
|
children = node.scoped_children[node.return_type.unwrap]
|
37
38
|
children.each_value do |child_node|
|
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.5.0.beta.
|
4
|
+
version: 0.5.0.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Rouse
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-08-
|
13
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description:
|
16
16
|
email:
|