graphql-fragment_cache 1.13.0 → 1.13.1
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/graphql/fragment_cache/fragment.rb +13 -8
- data/lib/graphql/fragment_cache/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9fe4856af12987ff49d92ed9551c46cb64634d48a0112c323436e953ec55990a
|
|
4
|
+
data.tar.gz: 0d69c3d4096474724b0ec6b409bb5ecdbbcda5b81f20e5ae035e1ae1c77f18ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19f8d2bb9bc21a2bb0b79244e230fbede1b19e60beeadee2d0e7197b4a531d044bc5ca85120300c70a7ef2892e125a2a89b820e86a6aad14c5bd7e4fc572ebbf
|
|
7
|
+
data.tar.gz: 136ba3362d1c7fddad10dac6c27f4f3b95b624d0c14dedef3cd28afa63a61330a5d4f95b92a2aeed47b70dfbfb5bf7690cc0f9695561d56a1e34d0fd2ebfd691
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## master
|
|
4
4
|
|
|
5
|
+
## 1.13.1 (2022-10-12)
|
|
6
|
+
|
|
7
|
+
- [PR#84](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/84) Fix Renew Cache Read Multi Bug ([@KTSCode][])
|
|
8
|
+
|
|
5
9
|
## 1.13.0 (2022-09-12)
|
|
6
10
|
|
|
7
11
|
- [PR#83](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/83) Update Lookahead usage to support graphql-2.0.14 ([@DmitryTsepelev][])
|
|
@@ -138,3 +142,4 @@
|
|
|
138
142
|
[@mretzak]: https://github.com/mretzak
|
|
139
143
|
[@daukadolt]: https://github.com/daukadolt
|
|
140
144
|
[@frostmark]: https://github.com/frostmark
|
|
145
|
+
[@KTSCode]: https://github.com/KTSCode
|
|
@@ -19,15 +19,20 @@ module GraphQL
|
|
|
19
19
|
fragments_to_cache_keys = fragments
|
|
20
20
|
.map { |f| [f, f.cache_key] }.to_h
|
|
21
21
|
|
|
22
|
-
cache_keys
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
# Filter out all the cache_keys for fragments with renew_cache: true in their context
|
|
23
|
+
cache_keys = fragments_to_cache_keys
|
|
24
|
+
.reject { |k, _v| k.context[:renew_cache] == true }.values
|
|
25
|
+
|
|
26
|
+
# If there are cache_keys look up values with read_multi otherwise return an empty hash
|
|
27
|
+
cache_keys_to_values = if cache_keys.empty?
|
|
28
|
+
{}
|
|
29
|
+
else
|
|
30
|
+
FragmentCache.cache_store.read_multi(*cache_keys)
|
|
31
|
+
end
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
# Fragmenst without values or with renew_cache: true in their context will have nil values like the read method
|
|
34
|
+
fragments_to_cache_keys
|
|
35
|
+
.map { |fragment, cache_key| [fragment, cache_keys_to_values[cache_key]] }.to_h
|
|
31
36
|
end
|
|
32
37
|
end
|
|
33
38
|
|
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: 1.13.
|
|
4
|
+
version: 1.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- DmitryTsepelev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-10-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: graphql
|