graphql-fragment_cache 0.1.5 → 0.1.6
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d83b3ff9d3e9cc91b6f013214d2cc4d97c6d2fc8bd377bf38d1f68dd7f935c23
|
4
|
+
data.tar.gz: d349157e8c6856c06b5a3ae76915399ae77fc04153093ef9551bb75b45629cb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 759813c8b9ae4373d9890519aa88573eb9a504771eca25ea7d7ddc2a35b972f172e1fb7e86bbd2f52447886e3c781178cfc7491c9a7257ce436ae411a32395fb
|
7
|
+
data.tar.gz: 78c75d761fc3154dd4a4622a36c5b0f7bbc4b26c31eb4bf3e3c6be4423be8ae64923d7207f02217142c213fa80e039410e2d079403c0258efd82543d9866e41d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.1.6 (2020-05-30)
|
6
|
+
|
7
|
+
- [PR#22](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/22) Properly cache entites inside collections ([@DmitryTsepelev][])
|
8
|
+
|
5
9
|
## 0.1.5 (2020-04-28)
|
6
10
|
|
7
11
|
- [PR#19](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/19) Add connections support ([@DmitryTsepelev][])
|
@@ -124,7 +124,12 @@ module GraphQL
|
|
124
124
|
|
125
125
|
def selections_cache_key
|
126
126
|
current_root =
|
127
|
-
path.reduce(query.lookahead) { |lkhd,
|
127
|
+
path.reduce(query.lookahead) { |lkhd, field_name|
|
128
|
+
# Handle cached fields inside collections:
|
129
|
+
next lkhd if field_name.is_a?(Integer)
|
130
|
+
|
131
|
+
lkhd.selection_with_alias(field_name)
|
132
|
+
}
|
128
133
|
|
129
134
|
current_root.selections.to_selections_key
|
130
135
|
end
|
@@ -133,6 +138,9 @@ module GraphQL
|
|
133
138
|
lookahead = query.lookahead
|
134
139
|
|
135
140
|
path.map { |field_name|
|
141
|
+
# Handle cached fields inside collections:
|
142
|
+
next field_name if field_name.is_a?(Integer)
|
143
|
+
|
136
144
|
lookahead = lookahead.selection_with_alias(field_name)
|
137
145
|
raise "Failed to look ahead the field: #{field_name}" if lookahead.is_a?(::GraphQL::Execution::Lookahead::NullLookahead)
|
138
146
|
|
@@ -124,7 +124,12 @@ module GraphQL
|
|
124
124
|
|
125
125
|
def selections_cache_key
|
126
126
|
current_root =
|
127
|
-
path.reduce(query.lookahead) { |lkhd,
|
127
|
+
path.reduce(query.lookahead) { |lkhd, field_name|
|
128
|
+
# Handle cached fields inside collections:
|
129
|
+
next lkhd if field_name.is_a?(Integer)
|
130
|
+
|
131
|
+
lkhd.selection_with_alias(field_name)
|
132
|
+
}
|
128
133
|
|
129
134
|
current_root.selections.to_selections_key
|
130
135
|
end
|
@@ -133,6 +138,9 @@ module GraphQL
|
|
133
138
|
lookahead = query.lookahead
|
134
139
|
|
135
140
|
path.map { |field_name|
|
141
|
+
# Handle cached fields inside collections:
|
142
|
+
next field_name if field_name.is_a?(Integer)
|
143
|
+
|
136
144
|
lookahead = lookahead.selection_with_alias(field_name)
|
137
145
|
raise "Failed to look ahead the field: #{field_name}" if lookahead.is_a?(::GraphQL::Execution::Lookahead::NullLookahead)
|
138
146
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-fragment_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.10.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: ruby-next
|
28
|
+
name: ruby-next
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.7.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: combustion
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|