graphql-fragment_cache 0.1.7 → 1.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96ef4de68daa875700330eed182cbbfeffb9c4dfff34dafd3661fc3513e06fc6
|
4
|
+
data.tar.gz: f24010337c683b12498c8c1cd949bb4ba43cb97dae80d9f617b0694a78329fdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5d84c411a488bac34c2e0c2237c3dcc7b51e44bd60195560ba81a8ee2cab6fd8d888f8946a103225b5dd14dc3202da4167a09901ad89264dee0bb3b34633fbd
|
7
|
+
data.tar.gz: 03bfa7468e8199ca87d81bcd8839f9dab0a7c6b4764538757727ad20d641c30da380af9b55a5496ef7ab77dafd444b2a8a39bd44d983d6e8eb53c0c63821f88f
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.0.0 (2020-06-13)
|
6
|
+
|
7
|
+
- [PR#24](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/24) Add nil caching. **BREAKING CHANGE**: custom cache stores must also implement `#exist?(key)` method ([@DmitryTsepelev][])
|
8
|
+
|
5
9
|
## 0.1.7 (2020-06-02)
|
6
10
|
|
7
11
|
- [PR#23](https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache/pull/23) Avoid extra queries after restoring connection from cache ([@DmitryTsepelev][])
|
data/README.md
CHANGED
@@ -252,7 +252,7 @@ Rails.application.configure do |config|
|
|
252
252
|
end
|
253
253
|
```
|
254
254
|
|
255
|
-
⚠️ Cache store must implement `#read(key)
|
255
|
+
⚠️ Cache store must implement `#read(key)`, `#write(key, value, **options)` and `#exist?(key)` methods.
|
256
256
|
|
257
257
|
The gem provides only in-memory store out-of-the-box (`GraphQL::FragmentCache::MemoryStore`). It's used by default.
|
258
258
|
|
@@ -16,8 +16,12 @@ module GraphQL
|
|
16
16
|
@path = interpreter_context[:current_path]
|
17
17
|
end
|
18
18
|
|
19
|
+
NIL_IN_CACHE = Object.new
|
20
|
+
|
19
21
|
def read
|
20
|
-
FragmentCache.cache_store.read(cache_key)
|
22
|
+
FragmentCache.cache_store.read(cache_key).tap do |cached|
|
23
|
+
return NIL_IN_CACHE if cached.nil? && FragmentCache.cache_store.exist?(cache_key)
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
def persist
|
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.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|