graphql-result_cache 0.1.4 → 0.1.5
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: 6cae5e83e05f6aae4a8ac2c26a6d2077d25c7fa32176234f347b0e8273a6ee3e
|
4
|
+
data.tar.gz: 77fb9355094bb37c82991a935e2f91058b7e2b7f93510c8037665a1f88df13d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caf21c2c2c7f4bdf29f714376f4867390f3b8f8ff894692d918574a300820abead72a13c8e321c67097381d5ffabc0b6c6de8bbfe95bb7d136e4d0fbd43e0c49
|
7
|
+
data.tar.gz: 35677cba82ea49aaf9bd94aa059249f80d6ef9caf35476a6edc418012d7467f1f53d52b0bd48ca3a73d428d4be362473f8cf05cec98d660f1f4b3a2d47fc5ffd
|
data/lib/graphql/result_cache.rb
CHANGED
@@ -39,7 +39,7 @@ module GraphQL
|
|
39
39
|
def cache_or_amend_result result, config_of_query
|
40
40
|
config_of_query.each do |config|
|
41
41
|
if config[:result].nil?
|
42
|
-
cache.write config[:key], result.dig('data', *config[:path]), expires_in: expires_in
|
42
|
+
cache.write config[:key], result.dig('data', *config[:path]), cache_write_options.merge(expires_in: expires_in)
|
43
43
|
else
|
44
44
|
# result already got from cache, need to amend to response
|
45
45
|
result_hash = result.to_h
|
@@ -78,6 +78,10 @@ module GraphQL
|
|
78
78
|
::GraphQL::ResultCache.cache
|
79
79
|
end
|
80
80
|
|
81
|
+
def cache_write_options
|
82
|
+
::GraphQL::ResultCache.cache_write_options || {}
|
83
|
+
end
|
84
|
+
|
81
85
|
def logger
|
82
86
|
::GraphQL::ResultCache.logger
|
83
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-result_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ying Fu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|